|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.xmcda_oo.utils.ExternalOrderingSet<E>
E - the elements to include in this set.public class ExternalOrderingSet<E>
TODO consider using some special interface instead of NavigableSet, because e.g. floor is not really
supported, and more generally asking for arbitrary object ordering information is not supported (only those objects
already known). Maybe simply use ListOrderedSet? Own interface could also support additions through the
NavigableSet.subSet(Object, Object) method.
TODO Document more.
Caution: contains(Object) work on every object; most methods work only on objects contained in this object.
| Method Summary | ||
|---|---|---|
boolean |
add(E e)
This method is implemented for compatibility with Set but should not be used with this object. |
|
void |
addAfter(E previous,
E toAdd)
|
|
boolean |
addAll(Collection<? extends E> c)
This method is implemented for compatibility with Set but should not be used with this object. |
|
void |
addAsBest(E e)
|
|
void |
addAsWorst(E e)
|
|
void |
addInBetween(E previous,
E e,
E next)
|
|
E |
ceiling(E e)
|
|
void |
clear()
|
|
Comparator<? super E> |
comparator()
|
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
static
|
create()
|
|
static
|
create(Collection<E> order)
Creates a new object initialized with the given collection, in order of iteration. |
|
Iterator<E> |
descendingIterator()
|
|
NavigableSet<E> |
descendingSet()
TODO not supported writing to it! |
|
boolean |
equals(Object o)
|
|
E |
first()
|
|
E |
floor(E e)
|
|
int |
hashCode()
|
|
SortedSet<E> |
headSet(E toElement)
|
|
NavigableSet<E> |
headSet(E toElement,
boolean inclusive)
|
|
E |
higher(E e)
|
|
boolean |
isEmpty()
|
|
Iterator<E> |
iterator()
|
|
E |
last()
|
|
E |
lower(E e)
|
|
E |
pollFirst()
|
|
E |
pollLast()
|
|
boolean |
remove(Object o)
|
|
boolean |
removeAll(Collection<?> c)
|
|
void |
replace(E oldElement,
E newElement)
|
|
void |
resetOrder(Collection<E> newOrder)
Changes the ordering of this set. |
|
boolean |
retainAll(Collection<?> c)
This method is implemented for compatibility with Set but should not be used with this object. |
|
int |
size()
|
|
NavigableSet<E> |
subSet(E fromElement,
boolean fromInclusive,
E toElement,
boolean toInclusive)
|
|
SortedSet<E> |
subSet(E fromElement,
E toElement)
|
|
SortedSet<E> |
tailSet(E fromElement)
|
|
NavigableSet<E> |
tailSet(E fromElement,
boolean inclusive)
|
|
Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean add(E e)
This method is implemented for compatibility with Set but should not be used with this object.
Ordering information must be given with any new element added as this object does not know otherwise how to treat
them compared to the other elements. Please use rather addAsBest(Object) or
addInBetween(Object, Object, Object).
add in interface Collection<E>add in interface Set<E>e -
UnsupportedOperationException - always.public boolean addAll(Collection<? extends E> c)
This method is implemented for compatibility with Set but should not be used with this object.
Ordering information must be given with any new element added as this object does not know otherwise how to treat
them compared to the other elements. Please use rather addAsBest(Object) or
addInBetween(Object, Object, Object).
addAll in interface Collection<E>addAll in interface Set<E>c -
UnsupportedOperationException - always.public void addAsBest(E e)
public void addInBetween(E previous,
E e,
E next)
public void addAfter(E previous,
E toAdd)
public E ceiling(E e)
ceiling in interface NavigableSet<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>public Comparator<? super E> comparator()
comparator in interface SortedSet<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<E>public Iterator<E> descendingIterator()
descendingIterator in interface NavigableSet<E>public NavigableSet<E> descendingSet()
descendingSet in interface NavigableSet<E>public boolean equals(Object o)
equals in interface Collection<E>equals in interface Set<E>equals in class Objectpublic E first()
first in interface SortedSet<E>public E floor(E e)
floor in interface NavigableSet<E>public int hashCode()
hashCode in interface Collection<E>hashCode in interface Set<E>hashCode in class Object
public NavigableSet<E> headSet(E toElement,
boolean inclusive)
headSet in interface NavigableSet<E>public SortedSet<E> headSet(E toElement)
headSet in interface NavigableSet<E>headSet in interface SortedSet<E>public E higher(E e)
higher in interface NavigableSet<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface NavigableSet<E>iterator in interface Set<E>public E last()
last in interface SortedSet<E>public E lower(E e)
lower in interface NavigableSet<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<E>public boolean retainAll(Collection<?> c)
This method is implemented for compatibility with Set but should not be used with this object.
Ordering information must be given with any new element added as this object does not know otherwise how to treat
them compared to the other elements. Please use rather addAsBest(Object) or
addInBetween(Object, Object, Object).
retainAll in interface Collection<E>retainAll in interface Set<E>c -
UnsupportedOperationException - always.public int size()
size in interface Collection<E>size in interface Set<E>
public NavigableSet<E> subSet(E fromElement,
boolean fromInclusive,
E toElement,
boolean toInclusive)
subSet in interface NavigableSet<E>
public SortedSet<E> subSet(E fromElement,
E toElement)
subSet in interface NavigableSet<E>subSet in interface SortedSet<E>
public NavigableSet<E> tailSet(E fromElement,
boolean inclusive)
tailSet in interface NavigableSet<E>public SortedSet<E> tailSet(E fromElement)
tailSet in interface NavigableSet<E>tailSet in interface SortedSet<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface Set<E>public E pollFirst()
pollFirst in interface NavigableSet<E>public E pollLast()
pollLast in interface NavigableSet<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>public static <E> ExternalOrderingSet<E> create()
public static <E> ExternalOrderingSet<E> create(Collection<E> order)
E - the type of the elements in the created set.order - not null. May be empty (in which case this comparator will not be able to compare any
objects until elements are added). One of the collection element may be null element
(which counts as a normal element for this object). The collection may not contain duplicate elements.
It is recommended to use a SortedSet when possible to ensure a correct iteration order and no
duplicate.
public void replace(E oldElement,
E newElement)
public void addAsWorst(E e)
public void resetOrder(Collection<E> newOrder)
newOrder - not null, no duplicate allowed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||