com.ibm.richtext.styledtext
Class MTabRuler

java.lang.Object
  |
  +--com.ibm.richtext.styledtext.MTabRuler
Direct Known Subclasses:
StandardTabRuler

public abstract class MTabRuler
extends java.lang.Object

This interface represents a sequence of TabStops, ordered by position. The first TabStop in the ruler can be obtained with the firstTab method; subsequent TabStops are obtained with the nextTab method.

If a TabStop with type TabStop.kAuto is returned, all tabs after that TabStop will also have type TabStop.kAuto, and their positions will be multiples of autoSpacing.

See Also:
TabStop

Constructor Summary
MTabRuler()
           
 
Method Summary
 MTabRuler addTab(TabStop tabToAdd)
          Return a tab ruler identical to this ruler, except with the given tab added.
abstract  int autoSpacing()
          Return the interval for autotabs.
 boolean containsTab(TabStop tabToTest)
          Return true if this tab ruler contains the given tab.
abstract  TabStop firstTab()
          Return first tab in the ruler.
 int hashCode()
          Compute the hashCode for this ruler.
 MTabRuler moveTab(int fromPosition, int toPosition)
          Return a tab ruler identical to this ruler, except with the tab at position fromPosition moved to position toPosition.
abstract  TabStop nextTab(int position)
          Return the first tab in the ruler with fPosition > position.
 MTabRuler removeTab(int position)
          Return a tab ruler identical to the given ruler, except with the tab at the given position removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTabRuler

public MTabRuler()
Method Detail

firstTab

public abstract TabStop firstTab()
Return first tab in the ruler. If an autoTab, it is at position zero, and all subsequent tabs will be autotabs at autoSpacing intervals.

nextTab

public abstract TabStop nextTab(int position)
Return the first tab in the ruler with fPosition > position. If it is an autotab, it is at an increment of autoSpacing, and all subsequent tabs will be autotabs at autoSpacing intervals.

autoSpacing

public abstract int autoSpacing()
Return the interval for autotabs.

hashCode

public final int hashCode()
Compute the hashCode for this ruler. The hashCode is the hashCode of the first tab multiplied by the autoSpacing interval.
Overrides:
hashCode in class java.lang.Object

containsTab

public boolean containsTab(TabStop tabToTest)
Return true if this tab ruler contains the given tab.
Parameters:
tabToTest - the tab to search for
Returns:
true if this tab ruler contains tabToTest

addTab

public MTabRuler addTab(TabStop tabToAdd)
Return a tab ruler identical to this ruler, except with the given tab added. This ruler is not modified.
Parameters:
tabToAdd - the tab to add to the new tab ruler
Returns:
an MTabRuler resulting from this operation

removeTab

public MTabRuler removeTab(int position)
Return a tab ruler identical to the given ruler, except with the tab at the given position removed. This ruler is not modified.
Parameters:
position - the position of the tab to remove from the new tab ruler
Returns:
an MTabRuler resulting from this operation

moveTab

public MTabRuler moveTab(int fromPosition,
                         int toPosition)
Return a tab ruler identical to this ruler, except with the tab at position fromPosition moved to position toPosition. This ruler is not modified.
Parameters:
fromPosition - the position of the tab to move
toPosition - the new position of the tab
Returns:
an MTabRuler resulting from this operation


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