- java.lang.Object
- 
- javax.accessibility.AccessibleRelationSet
 
- 
 public class AccessibleRelationSet extends Object ClassAccessibleRelationSetdetermines a component's relation set. The relation set of a component is a set ofAccessibleRelationobjects that describe the component's relationships with other components.- Since:
- 1.3
- See Also:
- AccessibleRelation
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected Vector<AccessibleRelation>relationsEach entry in theVectorrepresents anAccessibleRelation.
 - 
Constructor SummaryConstructors Constructor Description AccessibleRelationSet()Creates a new empty relation set.AccessibleRelationSet(AccessibleRelation[] relations)Creates a new relation with the initial set of relations contained in the array of relations passed in.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(AccessibleRelation relation)Adds a new relation to the current relation set.voidaddAll(AccessibleRelation[] relations)Adds all of the relations to the existing relation set.voidclear()Removes all the relations from the current relation set.booleancontains(String key)Returns whether the relation set contains a relation that matches the specified key.AccessibleRelationget(String key)Returns the relation that matches the specified key.booleanremove(AccessibleRelation relation)Removes a relation from the current relation set.intsize()Returns the number of relations in the relation set.AccessibleRelation[]toArray()Returns the current relation set as an array ofAccessibleRelation.StringtoString()Creates a localized string representing all the relations in the set using the default locale.
 
- 
- 
- 
Field Detail- 
relationsprotected Vector<AccessibleRelation> relations Each entry in theVectorrepresents anAccessibleRelation.
 
- 
 - 
Constructor Detail- 
AccessibleRelationSetpublic AccessibleRelationSet() Creates a new empty relation set.
 - 
AccessibleRelationSetpublic AccessibleRelationSet(AccessibleRelation[] relations) Creates a new relation with the initial set of relations contained in the array of relations passed in. Duplicate entries are ignored.- Parameters:
- relations- an array of- AccessibleRelationdescribing the relation set
 
 
- 
 - 
Method Detail- 
addpublic boolean add(AccessibleRelation relation) Adds a new relation to the current relation set. If the relation is already in the relation set, the target(s) of the specified relation is merged with the target(s) of the existing relation. Otherwise, the new relation is added to the relation set.- Parameters:
- relation- the relation to add to the relation set
- Returns:
- trueif relation is added to the relation set;- falseif the relation set is unchanged
 
 - 
addAllpublic void addAll(AccessibleRelation[] relations) Adds all of the relations to the existing relation set. Duplicate entries are ignored.- Parameters:
- relations-- AccessibleRelationarray describing the relation set
 
 - 
removepublic boolean remove(AccessibleRelation relation) Removes a relation from the current relation set. If the relation is not in the set, the relation set will be unchanged and the return value will befalse. If the relation is in the relation set, it will be removed from the set and the return value will betrue.- Parameters:
- relation- the relation to remove from the relation set
- Returns:
- trueif the relation is in the relation set;- falseif the relation set is unchanged
 
 - 
clearpublic void clear() Removes all the relations from the current relation set.
 - 
sizepublic int size() Returns the number of relations in the relation set.- Returns:
- the number of relations in the relation set
 
 - 
containspublic boolean contains(String key) Returns whether the relation set contains a relation that matches the specified key.- Parameters:
- key- the- AccessibleRelationkey
- Returns:
- trueif the relation is in the relation set; otherwise- false
 
 - 
getpublic AccessibleRelation get(String key) Returns the relation that matches the specified key.- Parameters:
- key- the- AccessibleRelationkey
- Returns:
- the relation, if one exists, that matches the specified key.
         Otherwise, nullis returned.
 
 - 
toArraypublic AccessibleRelation[] toArray() Returns the current relation set as an array ofAccessibleRelation.- Returns:
- AccessibleRelationarray contacting the current relation
 
 - 
toStringpublic String toString() Creates a localized string representing all the relations 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)
 
 
- 
 
-