|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.domains.ct.kernel.util.TotallyOrderedSet
Totally ordered set with no repeated elements. A repeated element is an element that the comparator returns 0 for.
| Red (johnr) |
| Yellow (liuj) |
| Constructor Summary | |
TotallyOrderedSet(java.util.Comparator comparator)
Construct the set with the given comparator. comparator is a blank final field that can't be changed after creation. |
|
| Method Summary | |
java.lang.Object |
at(int index)
Return the index-th element. |
void |
clear()
Clear the set. |
boolean |
contains(java.lang.Object obj)
Return true if the given element is contained in this set. |
java.util.List |
elementList()
Return a list of all the elements. |
java.util.Enumeration |
elements()
Deprecated. Use elementList() instead. |
java.lang.Object |
first()
Return the first element, ie. the "smallest" element. |
java.util.Comparator |
getComparator()
Return the comparator. |
int |
indexOf(java.lang.Object obj)
Return the index of the given object. |
void |
insert(java.lang.Object obj)
Insert the given element, keeping the set sorted. |
boolean |
isEmpty()
Return true if the set is empty |
void |
removeAllLessThan(java.lang.Object obj)
Remove all the elements that are (strictly) less than the argument. |
java.lang.Object |
removeAt(int index)
Remove and return the index-th element. |
java.lang.Object |
removeFirst()
Remove and return the first element, ie. the "smallest" element in the set.. |
int |
size()
Return the size of the set. |
java.lang.Object |
take()
Deprecated. Use removeFirst() instead. |
java.lang.String |
toString()
Return a String that consists of the contents of the elements in the set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TotallyOrderedSet(java.util.Comparator comparator)
comparator - The Comparator to compare elements.Comparator| Method Detail |
public java.lang.Object at(int index)
public void clear()
public boolean contains(java.lang.Object obj)
public java.util.List elementList()
public java.util.Enumeration elements()
public java.lang.Object first()
public java.util.Comparator getComparator()
public int indexOf(java.lang.Object obj)
public void insert(java.lang.Object obj)
obj - The element to be inserted.public boolean isEmpty()
public void removeAllLessThan(java.lang.Object obj)
obj - The argument.public java.lang.Object removeAt(int index)
index - The index of the element.
NoSuchElementException - If the specified index is
out of range.public java.lang.Object removeFirst()
NoSuchElementException - If the set is empty.public int size()
public java.lang.Object take()
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||