AccessibleRelationSet (Java Platform SE 8 ) (original) (raw)
- javax.accessibility.AccessibleRelationSet
public class AccessibleRelationSet
extends Object
Class AccessibleRelationSet determines a component's relation set. The relation set of a component is a set of AccessibleRelation objects that describe the component's relationships with other components.
Since:
1.3
See Also:
AccessibleRelation
Field Summary
Fields
Modifier and Type Field Description protected Vector<AccessibleRelation> relations Each entry in the Vector represents an AccessibleRelation. Constructor Summary
Constructors
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 Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description boolean add(AccessibleRelation relation) Adds a new relation to the current relation set. void addAll(AccessibleRelation[] relations) Adds all of the relations to the existing relation set. void clear() Removes all the relations from the current relation set. boolean contains(String key) Returns whether the relation set contains a relation that matches the specified key. AccessibleRelation get(String key) Returns the relation that matches the specified key. boolean remove(AccessibleRelation relation) Removes a relation from the current relation set. int size() Returns the number of relations in the relation set. AccessibleRelation[] toArray() Returns the current relation set as an array of AccessibleRelation String toString() Creates a localized String representing all the relations in the set using the default locale. * ### Methods inherited from class java.lang.[Object](../../java/lang/Object.html "class in java.lang") `[clone](../../java/lang/Object.html#clone--), [equals](../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../java/lang/Object.html#finalize--), [getClass](../../java/lang/Object.html#getClass--), [hashCode](../../java/lang/Object.html#hashCode--), [notify](../../java/lang/Object.html#notify--), [notifyAll](../../java/lang/Object.html#notifyAll--), [wait](../../java/lang/Object.html#wait--), [wait](../../java/lang/Object.html#wait-long-), [wait](../../java/lang/Object.html#wait-long-int-)`
Field Detail
* #### relations protected [Vector](../../java/util/Vector.html "class in java.util")<[AccessibleRelation](../../javax/accessibility/AccessibleRelation.html "class in javax.accessibility")> relations Each entry in the Vector represents an AccessibleRelation. See Also: [add(javax.accessibility.AccessibleRelation)](../../javax/accessibility/AccessibleRelationSet.html#add-javax.accessibility.AccessibleRelation-), [addAll(javax.accessibility.AccessibleRelation\[\])](../../javax/accessibility/AccessibleRelationSet.html#addAll-javax.accessibility.AccessibleRelation:A-), [remove(javax.accessibility.AccessibleRelation)](../../javax/accessibility/AccessibleRelationSet.html#remove-javax.accessibility.AccessibleRelation-), [contains(java.lang.String)](../../javax/accessibility/AccessibleRelationSet.html#contains-java.lang.String-), [get(java.lang.String)](../../javax/accessibility/AccessibleRelationSet.html#get-java.lang.String-), [size()](../../javax/accessibility/AccessibleRelationSet.html#size--), [toArray()](../../javax/accessibility/AccessibleRelationSet.html#toArray--), [clear()](../../javax/accessibility/AccessibleRelationSet.html#clear--)
Constructor Detail
* #### AccessibleRelationSet public AccessibleRelationSet() Creates a new empty relation set. * #### AccessibleRelationSet public AccessibleRelationSet([AccessibleRelation](../../javax/accessibility/AccessibleRelation.html "class in javax.accessibility")[] 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 AccessibleRelation describing the relation set.
Method Detail
* #### add public boolean add([AccessibleRelation](../../javax/accessibility/AccessibleRelation.html "class in javax.accessibility") 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: true if relation is added to the relation set; false if the relation set is unchanged * #### addAll public void addAll([AccessibleRelation](../../javax/accessibility/AccessibleRelation.html "class in javax.accessibility")[] relations) Adds all of the relations to the existing relation set. Duplicate entries are ignored. Parameters: `relations` \- AccessibleRelation array describing the relation set. * #### remove public boolean remove([AccessibleRelation](../../javax/accessibility/AccessibleRelation.html "class in javax.accessibility") 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 be false. If the relation is in the relation set, it will be removed from the set and the return value will be true. Parameters: `relation` \- the relation to remove from the relation set Returns: true if the relation is in the relation set; false if the relation set is unchanged * #### clear public void clear() Removes all the relations from the current relation set. * #### size public int size() Returns the number of relations in the relation set. Returns: the number of relations in the relation set * #### contains public boolean contains([String](../../java/lang/String.html "class in java.lang") key) Returns whether the relation set contains a relation that matches the specified key. Parameters: `key` \- the AccessibleRelation key Returns: true if the relation is in the relation set; otherwise false * #### get public [AccessibleRelation](../../javax/accessibility/AccessibleRelation.html "class in javax.accessibility") get([String](../../java/lang/String.html "class in java.lang") key) Returns the relation that matches the specified key. Parameters: `key` \- the AccessibleRelation key Returns: the relation, if one exists, that matches the specified key. Otherwise, null is returned. * #### toArray public [AccessibleRelation](../../javax/accessibility/AccessibleRelation.html "class in javax.accessibility")[] toArray() Returns the current relation set as an array of AccessibleRelation Returns: AccessibleRelation array contacting the current relation. * #### toString public [String](../../java/lang/String.html "class in java.lang") toString() Creates a localized String representing all the relations in the set using the default locale. Overrides: `[toString](../../java/lang/Object.html#toString--)` in class `[Object](../../java/lang/Object.html "class in java.lang")` Returns: comma separated localized String See Also: [AccessibleBundle.toDisplayString(java.lang.String, java.util.Locale)](../../javax/accessibility/AccessibleBundle.html#toDisplayString-java.lang.String-java.util.Locale-)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.