|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet
edu.emory.mathcs.backport.java.util.TreeSet
public class TreeSet
| Constructor Summary | |
|---|---|
TreeSet()
|
|
TreeSet(java.util.Collection c)
|
|
TreeSet(java.util.Comparator comparator)
|
|
TreeSet(java.util.SortedSet s)
|
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
java.lang.Object |
ceiling(java.lang.Object e)
Returns the least element in this set greater than or equal to the given element, or null if there is no such element. |
void |
clear()
|
java.lang.Object |
clone()
|
java.util.Comparator |
comparator()
|
boolean |
contains(java.lang.Object o)
|
java.util.Iterator |
descendingIterator()
Returns an iterator over the elements in this set, in descending order. |
NavigableSet |
descendingSet()
Returns a reverse order view of the elements contained in this set. |
java.lang.Object |
first()
|
java.lang.Object |
floor(java.lang.Object e)
Returns the greatest element in this set less than or equal to the given element, or null if there is no such element. |
java.util.SortedSet |
headSet(java.lang.Object toElement)
|
NavigableSet |
headSet(java.lang.Object toElement,
boolean toInclusive)
Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement. |
java.lang.Object |
higher(java.lang.Object e)
Returns the least element in this set strictly greater than the given element, or null if there is no such element. |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
Returns an iterator over the elements in this set, in ascending order. |
java.lang.Object |
last()
|
java.lang.Object |
lower(java.lang.Object e)
Returns the greatest element in this set strictly less than the given element, or null if there is no such element. |
java.lang.Object |
pollFirst()
Retrieves and removes the first (lowest) element, or returns null if this set is empty. |
java.lang.Object |
pollLast()
Retrieves and removes the last (highest) element, or returns null if this set is empty. |
boolean |
remove(java.lang.Object o)
|
int |
size()
|
NavigableSet |
subSet(java.lang.Object fromElement,
boolean fromInclusive,
java.lang.Object toElement,
boolean toInclusive)
Returns a view of the portion of this set whose elements range from fromElement to toElement. |
java.util.SortedSet |
subSet(java.lang.Object fromElement,
java.lang.Object toElement)
|
java.util.SortedSet |
tailSet(java.lang.Object fromElement)
|
NavigableSet |
tailSet(java.lang.Object fromElement,
boolean fromInclusive)
Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is true) fromElement. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
containsAll, equals, hashCode, removeAll, retainAll |
| Constructor Detail |
|---|
public TreeSet()
public TreeSet(java.util.Comparator comparator)
public TreeSet(java.util.Collection c)
public TreeSet(java.util.SortedSet s)
| Method Detail |
|---|
public java.lang.Object lower(java.lang.Object e)
NavigableSetnull if there is no such element.
lower in interface NavigableSete - the value to match
e,
or null if there is no such elementpublic java.lang.Object floor(java.lang.Object e)
NavigableSetnull if there is no such element.
floor in interface NavigableSete - the value to match
e,
or null if there is no such elementpublic java.lang.Object ceiling(java.lang.Object e)
NavigableSetnull if there is no such element.
ceiling in interface NavigableSete - the value to match
e,
or null if there is no such elementpublic java.lang.Object higher(java.lang.Object e)
NavigableSetnull if there is no such element.
higher in interface NavigableSete - the value to match
e,
or null if there is no such elementpublic java.lang.Object pollFirst()
NavigableSetnull if this set is empty.
pollFirst in interface NavigableSetnull if this set is emptypublic java.lang.Object pollLast()
NavigableSetnull if this set is empty.
pollLast in interface NavigableSetnull if this set is emptypublic java.util.Iterator iterator()
NavigableSet
iterator in interface NavigableSetiterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.AbstractCollectionpublic java.util.Iterator descendingIterator()
NavigableSetdescendingSet().iterator().
descendingIterator in interface NavigableSet
public java.util.SortedSet subSet(java.lang.Object fromElement,
java.lang.Object toElement)
NavigableSetEquivalent to subSet(fromElement, true, toElement, false).
subSet in interface NavigableSetsubSet in interface java.util.SortedSetpublic java.util.SortedSet headSet(java.lang.Object toElement)
NavigableSetEquivalent to headSet(toElement, false).
headSet in interface NavigableSetheadSet in interface java.util.SortedSetpublic java.util.SortedSet tailSet(java.lang.Object fromElement)
NavigableSetEquivalent to tailSet(fromElement, true).
tailSet in interface NavigableSettailSet in interface java.util.SortedSet
public NavigableSet subSet(java.lang.Object fromElement,
boolean fromInclusive,
java.lang.Object toElement,
boolean toInclusive)
NavigableSetfromElement to toElement. If fromElement and
toElement are equal, the returned set is empty unless fromExclusive and toExclusive are both true. The returned set
is backed by this set, so changes in the returned set are reflected in
this set, and vice-versa. The returned set supports all optional set
operations that this set supports.
The returned set will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
subSet in interface NavigableSetfromElement - low endpoint of the returned setfromInclusive - true if the low endpoint
is to be included in the returned viewtoElement - high endpoint of the returned settoInclusive - true if the high endpoint
is to be included in the returned view
fromElement, inclusive, to toElement, exclusive
public NavigableSet headSet(java.lang.Object toElement,
boolean toInclusive)
NavigableSetinclusive is true) toElement. The
returned set is backed by this set, so changes in the returned set are
reflected in this set, and vice-versa. The returned set supports all
optional set operations that this set supports.
The returned set will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
headSet in interface NavigableSettoElement - high endpoint of the returned settoInclusive - true if the high endpoint
is to be included in the returned view
inclusive is true) toElement
public NavigableSet tailSet(java.lang.Object fromElement,
boolean fromInclusive)
NavigableSetinclusive is true) fromElement.
The returned set is backed by this set, so changes in the returned set
are reflected in this set, and vice-versa. The returned set supports
all optional set operations that this set supports.
The returned set will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
tailSet in interface NavigableSetfromElement - low endpoint of the returned setfromInclusive - true if the low endpoint
is to be included in the returned view
fromElementpublic NavigableSet descendingSet()
NavigableSetremove operation), the results of
the iteration are undefined.
The returned set has an ordering equivalent to
Collections.reverseOrder(comparator()).
The expression s.descendingSet().descendingSet() returns a
view of s essentially equivalent to s.
descendingSet in interface NavigableSetpublic java.util.Comparator comparator()
comparator in interface java.util.SortedSetpublic java.lang.Object first()
first in interface java.util.SortedSetpublic java.lang.Object last()
last in interface java.util.SortedSetpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.AbstractCollectionpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.SetisEmpty in class java.util.AbstractCollectionpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setcontains in class java.util.AbstractCollectionpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class java.util.AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class java.util.AbstractCollectionpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.AbstractCollectionpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.AbstractCollectionpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.SetaddAll in class java.util.AbstractCollectionpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setclear in class java.util.AbstractCollectionpublic java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||