javax.swing.text

Class TabSet

public class TabSet extends Object implements Serializable

A set of tab stops. Instances of this class are immutable.
Constructor Summary
TabSet(TabStop[] t)
Creates a new TabSet containing the specified tab stops.
Method Summary
booleanequals(Object obj)
Tests this TabSet for equality with an arbitrary object.
TabStopgetTab(int i)
Returns the tab stop with the specified index.
TabStopgetTabAfter(float location)
Returns the tab following the specified location.
intgetTabCount()
Returns the number of tab stops in this tab set.
intgetTabIndex(TabStop tab)
Returns the index of the specified tab, or -1 if the tab is not found.
intgetTabIndexAfter(float location)
Returns the index of the tab at or after the specified location.
inthashCode()
Returns a hash code for this TabSet.
StringtoString()
Returns a string representation of this TabSet.

Constructor Detail

TabSet

public TabSet(TabStop[] t)
Creates a new TabSet containing the specified tab stops.

Parameters: t the tab stops (null permitted).

Method Detail

equals

public boolean equals(Object obj)
Tests this TabSet for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: true if this TabSet is equal to obj, and false otherwise.

Since: 1.5

getTab

public TabStop getTab(int i)
Returns the tab stop with the specified index.

Parameters: i the index.

Returns: The tab stop.

Throws: IllegalArgumentException if i is not in the range 0 to getTabCount() - 1.

getTabAfter

public TabStop getTabAfter(float location)
Returns the tab following the specified location.

Parameters: location the location.

Returns: The tab following the specified location (or null).

getTabCount

public int getTabCount()
Returns the number of tab stops in this tab set.

Returns: The number of tab stops in this tab set.

getTabIndex

public int getTabIndex(TabStop tab)
Returns the index of the specified tab, or -1 if the tab is not found.

Parameters: tab the tab (null permitted).

Returns: The index of the specified tab, or -1.

getTabIndexAfter

public int getTabIndexAfter(float location)
Returns the index of the tab at or after the specified location.

Parameters: location the tab location.

Returns: The index of the tab stop, or -1.

hashCode

public int hashCode()
Returns a hash code for this TabSet.

Returns: A hash code.

Since: 1.5

toString

public String toString()
Returns a string representation of this TabSet.

Returns: A string representation of this TabSet.