Top Description Fields Constructors Methods
javax.accessibility

public Class AccessibleRelationSet

extends Object
Class Inheritance
Imports
java.util.Vector

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.
Author
Lynn Monsanto
Since
1.3
See Also
AccessibleRelation

Field Summary

Modifier and TypeField and Description
protected Vector<AccessibleRelation>
relations

Each entry in the Vector represents an AccessibleRelation.

Constructor Summary

AccessConstructor and Description
public
AccessibleRelationSet()

Creates a new empty relation set.

public
AccessibleRelationSet(AccessibleRelation[]
an array of AccessibleRelation describing the relation set
relations
)

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

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if relation is added to the relation set; false if the relation set is unchanged
add
(AccessibleRelation
the relation to add to the relation set
relation
)

Adds a new relation to the current relation set.

public void
addAll(AccessibleRelation[]
AccessibleRelation array describing the relation set
relations
)

Adds all of the relations to the existing relation set.

public void
clear()

Removes all the relations from the current relation set.

public boolean

Returns:

true if the relation is in the relation set; otherwise false
contains
(String
the AccessibleRelation key
key
)

Returns whether the relation set contains a relation that matches the specified key.

public AccessibleRelation

Returns:

the relation, if one exists, that matches the specified key. Otherwise, null is returned.
get
(String
the AccessibleRelation key
key
)

Returns the relation that matches the specified key.

public boolean

Returns:

true if the relation is in the relation set; false if the relation set is unchanged
remove
(AccessibleRelation
the relation to remove from the relation set
relation
)

Removes a relation from the current relation set.

public int

Returns:

the number of relations in the relation set
size
()

Returns the number of relations in the relation set.

public AccessibleRelation[]

Returns:

AccessibleRelation array contacting the current relation
toArray
()

Returns the current relation set as an array of AccessibleRelation.

public String

Returns:

comma separated localized string
toString
()

Overrides java.lang.Object.toString.

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

relationsback to summary
protected Vector<AccessibleRelation> relations

Each entry in the Vector represents an AccessibleRelation.

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

Constructor Detail

AccessibleRelationSetback to summary
public AccessibleRelationSet()

Creates a new empty relation set.

AccessibleRelationSetback to summary
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
relations:AccessibleRelation[]

an array of AccessibleRelation describing the relation set

Method Detail

addback to summary
public 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:AccessibleRelation

the relation to add to the relation set

Returns:boolean

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

addAllback to summary
public void addAll(AccessibleRelation[] relations)

Adds all of the relations to the existing relation set. Duplicate entries are ignored.

Parameters
relations:AccessibleRelation[]

AccessibleRelation array describing the relation set

clearback to summary
public void clear()

Removes all the relations from the current relation set.

containsback to summary
public boolean contains(String key)

Returns whether the relation set contains a relation that matches the specified key.

Parameters
key:String

the AccessibleRelation key

Returns:boolean

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

getback to summary
public AccessibleRelation get(String key)

Returns the relation that matches the specified key.

Parameters
key:String

the AccessibleRelation key

Returns:AccessibleRelation

the relation, if one exists, that matches the specified key. Otherwise, null is returned.

removeback to summary
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:AccessibleRelation

the relation to remove from the relation set

Returns:boolean

true if the relation is in the relation set; false if the relation set is unchanged

sizeback to summary
public int size()

Returns the number of relations in the relation set.

Returns:int

the number of relations in the relation set

toArrayback to summary
public AccessibleRelation[] toArray()

Returns the current relation set as an array of AccessibleRelation.

Returns:AccessibleRelation[]

AccessibleRelation array contacting the current relation

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

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

Returns:String

comma separated localized string

See Also
AccessibleBundle#toDisplayString