Class TabStop

java.lang.Object
com.codename1.wordprocessing.TabStop

public final class TabStop extends Object

A tab stop: where the text after a tab character lines up.

A left stop starts the text at the stop, a right stop ends it there, a center stop centers it on the stop and a decimal stop lines the first period up with it. The leader fills the gap the tab leaves, as in a table of contents.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    LEFT, CENTER, RIGHT or DECIMAL.
    static final String
    Text is centered on the stop.
    static final String
    The first period of the text sits at the stop.
    final char
    The character repeated across the gap: a period, a hyphen, an underscore, or 0 for none.
    static final String
    Text starts at the stop.
    final float
    The distance from the paragraph's left indent, in points.
    static final String
    Text ends at the stop.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TabStop(float position, String alignment, char leader)
    Creates a stop.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Two stops are equal when their position, alignment and leader are.
    int
    A hash consistent with equals.

    Methods inherited from class Object

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

    • LEFT

      public static final String LEFT
      Text starts at the stop.
      See Also:
    • CENTER

      public static final String CENTER
      Text is centered on the stop.
      See Also:
    • DECIMAL

      public static final String DECIMAL
      The first period of the text sits at the stop.
      See Also:
    • position

      public final float position
      The distance from the paragraph's left indent, in points.
    • alignment

      public final String alignment
      LEFT, CENTER, RIGHT or DECIMAL.
    • leader

      public final char leader
      The character repeated across the gap: a period, a hyphen, an underscore, or 0 for none.
  • Constructor Details

    • TabStop

      public TabStop(float position, String alignment, char leader)

      Creates a stop.

      Parameters
      • position: points from the left indent, 0 to 2000

      • alignment: LEFT, CENTER, RIGHT or DECIMAL; anything else is LEFT

      • leader: a period, hyphen or underscore, or 0 for none; anything else is none

  • Method Details

    • equals

      public boolean equals(Object o)

      Two stops are equal when their position, alignment and leader 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