- java.lang.Object
- 
- javax.accessibility.AccessibleStateSet
 
- 
 public class AccessibleStateSet extends Object ClassAccessibleStateSetdetermines a component's state set. The state set of a component is a set ofAccessibleStateobjects and descriptions. E.G., The current overall state of the object, such as whether it is enabled, has focus, etc.- See Also:
- AccessibleState
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected Vector<AccessibleState>statesEach entry in theVectorrepresents anAccessibleState.
 - 
Constructor SummaryConstructors Constructor Description AccessibleStateSet()Creates a new empty state set.AccessibleStateSet(AccessibleState[] states)Creates a new state with the initial set of states contained in the array of states passed in.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(AccessibleState state)Adds a new state to the current state set if it is not already present.voidaddAll(AccessibleState[] states)Adds all of the states to the existing state set.voidclear()Removes all the states from the current state set.booleancontains(AccessibleState state)Checks if the current state is in the state set.booleanremove(AccessibleState state)Removes a state from the current state set.AccessibleState[]toArray()Returns the current state set as an array ofAccessibleState.StringtoString()Creates a localized string representing all the states in the set using the default locale.
 
- 
- 
- 
Field Detail- 
statesprotected Vector<AccessibleState> states Each entry in theVectorrepresents anAccessibleState.
 
- 
 - 
Constructor Detail- 
AccessibleStateSetpublic AccessibleStateSet() Creates a new empty state set.
 - 
AccessibleStateSetpublic 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- an array of- AccessibleStatedescribing the state set
 
 
- 
 - 
Method Detail- 
addpublic 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 isfalse. Otherwise, the state is added to the state set and the return value istrue.- Parameters:
- state- the state to add to the state set
- Returns:
- trueif state is added to the state set;- falseif the state set is unchanged
 
 - 
addAllpublic void addAll(AccessibleState[] states) Adds all of the states to the existing state set. Duplicate entries are ignored.- Parameters:
- states-- AccessibleStatearray describing the state set
 
 - 
removepublic 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 befalse. If the state is in the state set, it will be removed from the set and the return value will betrue.- Parameters:
- state- the state to remove from the state set
- Returns:
- trueif the state is in the state set;- falseif the state set will be unchanged
 
 - 
clearpublic void clear() Removes all the states from the current state set.
 - 
containspublic boolean contains(AccessibleState state) Checks if the current state is in the state set.- Parameters:
- state- the state
- Returns:
- trueif the state is in the state set; otherwise- false
 
 - 
toArraypublic AccessibleState[] toArray() Returns the current state set as an array ofAccessibleState.- Returns:
- AccessibleStatearray containing the current state
 
 - 
toStringpublic String toString() Creates a localized string representing all the states in the set using the default locale.- Overrides:
- toStringin class- Object
- Returns:
- comma separated localized string
- See Also:
- AccessibleBundle.toDisplayString(java.lang.String, java.util.Locale)
 
 
- 
 
-