E - the element typepublic interface PartiallyOrderedSet<E> extends Set<E>
Objects 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 unsetOrdering methods.| Modifier and Type | Method and Description |
|---|---|
boolean |
hasOrdering(E preferred,
E other)
Returns
true if an ordering exists between two elements. |
boolean |
setOrdering(E first,
E second)
Sets an ordering between two elements.
|
boolean |
unsetOrdering(E first,
E second)
Removes any ordering between two elements.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamboolean setOrdering(E first, E second)
first - the first elementsecond - the second elementtrue if no prior ordering existed between the elements, false otherwise.boolean unsetOrdering(E first, E second)
first - the first elementsecond - the second elementtrue if an ordering existed between the elements.