JavaTM 2 Platform
Std. Ed. v1.3.1

javax.accessibility
Class AccessibleRelationSet

java.lang.Object
  |
  +--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.

See Also:
AccessibleRelation

Field Summary
protected  Vector relations
          Each entry in the Vector represents an AccessibleRelation.
 
Constructor Summary
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
 boolean add(AccessibleRelation relation)
          Adds a new relation to the current relation set if it is not already present.
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

relations

protected Vector relations
Each entry in the Vector represents an AccessibleRelation.
See Also:
add(javax.accessibility.AccessibleRelation), addAll(javax.accessibility.AccessibleRelation[]), remove(javax.accessibility.AccessibleRelation), contains(java.lang.String), get(java.lang.String), size(), toArray(), clear()
Constructor Detail

AccessibleRelationSet

public AccessibleRelationSet()
Creates a new empty relation set.

AccessibleRelationSet

public 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:
relation - an array of AccessibleRelation describing the relation set.
Method Detail

add

public boolean add(AccessibleRelation relation)
Adds a new relation to the current relation set if it is not already present. If the relation is already in the relation set, the relation set is unchanged and the return value is false. Otherwise, the relation is added to the relation set and the return value is true.
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[] relations)
Adds all of the relations to the existing relation set. Duplicate entries are ignored.
Parameters:
relation - AccessibleRelation array describing the relation set.

remove

public 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 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.

contains

public boolean contains(String 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 get(String 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[] toArray()
Returns the current relation set as an array of AccessibleRelation
Returns:
AccessibleRelation array contacting the current relation.

toString

public String toString()
Creates a localized String representing all the relations in the set using the default locale.
Overrides:
toString in class Object
Returns:
comma separated localized String
See Also:
AccessibleBundle.toDisplayString(java.lang.String, java.util.Locale)

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.