Class SectionBreak

java.lang.Object
com.codename1.wordprocessing.SectionBreak
All Implemented Interfaces:
Block

public final class SectionBreak extends Object implements Block

Starts a new section: the blocks after it, up to the next break, are laid out on the page this break gives, with its margins, orientation and columns. The blocks before the first break use the document's own page.

A break that does not start a new page (continuous) only changes the columns; the text before it is balanced across its own columns first, as a word processor does, so a page can carry a one-column heading over three-column text.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    The block id.
    final boolean
    Whether the section starts on a new page; false continues on the current one.
    final PageSpec
    The page of the section that starts here.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SectionBreak(String id, PageSpec page, boolean newPage)
    Creates a break.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Two breaks are equal when their id, page and start are.
    int
    A hash consistent with equals.
    id()
    The block id.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      public final String id
      The block id.
    • page

      public final PageSpec page
      The page of the section that starts here.
    • newPage

      public final boolean newPage
      Whether the section starts on a new page; false continues on the current one.
  • Constructor Details

    • SectionBreak

      public SectionBreak(String id, PageSpec page, boolean newPage)

      Creates a break.

      Parameters
      • id: the block id

      • page: the page of the section that starts here, or null for A4

      • newPage: whether the section starts on a new page

  • Method Details

    • id

      public String id()

      The block id.

      Returns

      the id

      Specified by:
      id in interface Block
    • equals

      public boolean equals(Object o)

      Two breaks are equal when their id, page and start are.

      Parameters
      • o: the other object
      Returns

      true when equal

      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()

      A hash consistent with equals.

      Returns

      the hash

      Overrides:
      hashCode in class Object