| java.util.AbstractSet javax.imageio.spi.PartiallyOrderedSet
PartiallyOrderedSet | class PartiallyOrderedSet extends AbstractSet (Code) | | A set of Object s with pairwise orderings between them.
The iterator method provides the elements in
topologically sorted order. Elements participating in a cycle
are not returned.
Unlike the SortedSet and SortedMap
interfaces, which require their elements to implement the
Comparable interface, this class receives ordering
information via its setOrdering and
unsetPreference methods. This difference is due to
the fact that the relevant ordering between elements is unlikely to
be inherent in the elements themselves; rather, it is set
dynamically accoring to application policy. For example, in a
service provider registry situation, an application might allow the
user to set a preference order for service provider objects
supplied by a trusted vendor over those supplied by another.
version: 0.5 |
Method Summary | |
public boolean | add(Object o) Adds an Object to this
PartiallyOrderedSet . | public void | clear() | public boolean | contains(Object o) | public boolean | hasOrdering(Object preferred, Object other) Returns true if an ordering exists between two
nodes. | public Iterator | iterator() Returns an iterator over the elements contained in this
collection, with an ordering that respects the orderings set
by the setOrdering method. | public boolean | remove(Object o) Removes an Object from this
PartiallyOrderedSet . | public boolean | setOrdering(Object first, Object second) Sets an ordering between two nodes. | public int | size() | public boolean | unsetOrdering(Object first, Object second) Removes any ordering between two nodes. |
PartiallyOrderedSet | public PartiallyOrderedSet()(Code) | | Constructs a PartiallyOrderedSet .
|
add | public boolean add(Object o)(Code) | | Adds an Object to this
PartiallyOrderedSet .
|
clear | public void clear()(Code) | | |
hasOrdering | public boolean hasOrdering(Object preferred, Object other)(Code) | | Returns true if an ordering exists between two
nodes.
|
iterator | public Iterator iterator()(Code) | | Returns an iterator over the elements contained in this
collection, with an ordering that respects the orderings set
by the setOrdering method.
|
remove | public boolean remove(Object o)(Code) | | Removes an Object from this
PartiallyOrderedSet .
|
setOrdering | public boolean setOrdering(Object first, Object second)(Code) | | Sets an ordering between two nodes. When an iterator is
requested, the first node will appear earlier in the
sequence than the second node. If a prior ordering existed
between the nodes in the opposite order, it is removed.
true if no prior ordering existedbetween the nodes, false otherwise. |
unsetOrdering | public boolean unsetOrdering(Object first, Object second)(Code) | | Removes any ordering between two nodes.
true if a prior prefence existed between the nodes. |
|
|