Top Description Fields Constructors Methods
javax.accessibility

public Class AccessibleStateSet

extends Object
Class Inheritance
Imports
java.util.Vector

Class AccessibleStateSet determines a component's state set. The state set of a component is a set of AccessibleState objects and descriptions. E.G., The current overall state of the object, such as whether it is enabled, has focus, etc.
Author
Willie Walker
See Also
AccessibleState

Field Summary

Modifier and TypeField and Description
protected Vector<AccessibleState>
states

Each entry in the Vector represents an AccessibleState.

Constructor Summary

AccessConstructor and Description
public
AccessibleStateSet()

Creates a new empty state set.

public
AccessibleStateSet(AccessibleState[]
an array of AccessibleState describing the state set
states
)

Creates a new state with the initial set of states contained in the array of states passed in. Duplicate entries are ignored.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if state is added to the state set; false if the state set is unchanged
add
(AccessibleState
the state to add to the state set
state
)

Adds a new state to the current state set if it is not already present.

public void
addAll(AccessibleState[]
AccessibleState array describing the state set
states
)

Adds all of the states to the existing state set.

public void
clear()

Removes all the states from the current state set.

public boolean

Returns:

true if the state is in the state set; otherwise false
contains
(AccessibleState
the state
state
)

Checks if the current state is in the state set.

public boolean

Returns:

true if the state is in the state set; false if the state set will be unchanged
remove
(AccessibleState
the state to remove from the state set
state
)

Removes a state from the current state set.

public AccessibleState[]

Returns:

AccessibleState array containing the current state
toArray
()

Returns the current state set as an array of AccessibleState.

public String

Returns:

comma separated localized string
toString
()

Overrides java.lang.Object.toString.

Creates a localized string representing all the states in the set using the default locale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

statesback to summary
protected Vector<AccessibleState> states

Each entry in the Vector represents an AccessibleState.

See Also
add, addAll, remove, contains, toArray, clear

Constructor Detail

AccessibleStateSetback to summary
public AccessibleStateSet()

Creates a new empty state set.

AccessibleStateSetback to summary
public AccessibleStateSet(AccessibleState[] states)

Creates a new state with the initial set of states contained in the array of states passed in. Duplicate entries are ignored.

Parameters
states:AccessibleState[]

an array of AccessibleState describing the state set

Method Detail

addback to summary
public boolean add(AccessibleState state)

Adds a new state to the current state set if it is not already present. If the state is already in the state set, the state set is unchanged and the return value is false. Otherwise, the state is added to the state set and the return value is true.

Parameters
state:AccessibleState

the state to add to the state set

Returns:boolean

true if state is added to the state set; false if the state set is unchanged

addAllback to summary
public void addAll(AccessibleState[] states)

Adds all of the states to the existing state set. Duplicate entries are ignored.

Parameters
states:AccessibleState[]

AccessibleState array describing the state set

clearback to summary
public void clear()

Removes all the states from the current state set.

containsback to summary
public boolean contains(AccessibleState state)

Checks if the current state is in the state set.

Parameters
state:AccessibleState

the state

Returns:boolean

true if the state is in the state set; otherwise false

removeback to summary
public boolean remove(AccessibleState state)

Removes a state from the current state set. If the state is not in the set, the state set will be unchanged and the return value will be false. If the state is in the state set, it will be removed from the set and the return value will be true.

Parameters
state:AccessibleState

the state to remove from the state set

Returns:boolean

true if the state is in the state set; false if the state set will be unchanged

toArrayback to summary
public AccessibleState[] toArray()

Returns the current state set as an array of AccessibleState.

Returns:AccessibleState[]

AccessibleState array containing the current state

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Creates a localized string representing all the states in the set using the default locale.

Returns:String

comma separated localized string

See Also
AccessibleBundle#toDisplayString