com.ibm.richtext.styledtext
Class TabStop

java.lang.Object
  |
  +--com.ibm.richtext.styledtext.TabStop
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public final class TabStop
extends java.lang.Object
implements java.io.Externalizable

TabStop represents a position on a tab ruler. Each tab stop has a position, giving its location on the ruler, and one of several types. The type determines how a segment controled by this TabStop is positioned on a line:

See Also:
MTabRuler, Serialized Form

Field Summary
static byte kAuto
          A TabStop with this type aligns its segment's leading edge to the TabStop's position.
static byte kCenter
          A TabStop with this type aligns its segment's center to the TabStop's position.
static byte kDecimal
          A TabStop with this type aligns its segment's first decimal to the TabStop's position.
static byte kLeading
          A TabStop with this type aligns its segment's leading edge to the TabStop's position.
static byte kTrailing
          A TabStop with this type aligns its segment's trailing edge to the TabStop's position.
 
Constructor Summary
TabStop()
          Create a TabStop with position 0 and type kLeading.
TabStop(int position, byte type)
          Create a TabStop with the given position and type.
 
Method Summary
 boolean equals(java.lang.Object rhs)
          Compare this to another Object.
 int getPosition()
          Return the position of this TabStop.
 byte getType()
          Return the type of this TabStop.
 int hashCode()
          Return the hash code for this TabStop.
 void readExternal(java.io.ObjectInput in)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

kLeading

public static final byte kLeading
A TabStop with this type aligns its segment's leading edge to the TabStop's position.

kCenter

public static final byte kCenter
A TabStop with this type aligns its segment's center to the TabStop's position.

kTrailing

public static final byte kTrailing
A TabStop with this type aligns its segment's trailing edge to the TabStop's position.

kDecimal

public static final byte kDecimal
A TabStop with this type aligns its segment's first decimal to the TabStop's position.

kAuto

public static final byte kAuto
A TabStop with this type aligns its segment's leading edge to the TabStop's position. After a TabStop of this type, all tabs are at autospace intervals. Usually, clients will not construct TabStops with this type.
Constructor Detail

TabStop

public TabStop()
Create a TabStop with position 0 and type kLeading.

TabStop

public TabStop(int position,
               byte type)
Create a TabStop with the given position and type.
Parameters:
position - the TabStop's position
type - the TabStop's type. Must be one of constants in this class.
Method Detail

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable

equals

public boolean equals(java.lang.Object rhs)
Compare this to another Object. TabStops are equal if their position and type are the same.
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Return the hash code for this TabStop. The hash code is position << type.
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getType

public byte getType()
Return the type of this TabStop. Will be one of the constants in this class.

getPosition

public int getPosition()
Return the position of this TabStop.


Copyright (c) 1998-2000 IBM Corporation and others.