|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoracle.adfnmc.java.util.AbstractCollection
oracle.adfnmc.java.util.AbstractSet
oracle.adfnmc.java.util.TreeSet
public class TreeSet
TreeSet is an implementation of SortedSet. All optional operations are supported, adding and removing. The elements can be any objects which are comparable to each other either using their natural order or a specified Comparator.
| Constructor Summary | |
|---|---|
TreeSet()
Constructs a new empty instance of TreeSet which uses natural ordering. |
|
TreeSet(Collection collection)
Constructs a new instance of TreeSet which uses natural ordering and containing the unique elements in the specified collection. |
|
TreeSet(Comparator comparator)
Constructs a new empty instance of TreeSet which uses the specified Comparator. |
|
TreeSet(SortedSet set)
Constructs a new instance of TreeSet containing the elements in the specified SortedSet and using the same Comparator. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object object)
Adds the specified object to this TreeSet. |
boolean |
addAll(Collection collection)
Adds the objects in the specified Collection to this TreeSet. |
void |
clear()
Removes all elements from this TreeSet, leaving it empty. |
java.lang.Object |
clone()
Answers a new TreeSet with the same elements, size and comparator as this TreeSet. |
Comparator |
comparator()
Answers the Comparator used to compare elements in this TreeSet. |
boolean |
contains(java.lang.Object object)
Searches this TreeSet for the specified object. |
java.lang.Object |
first()
Answers the first element in this TreeSet. |
SortedSet |
headSet(java.lang.Object end)
Answers a SortedSet of the specified portion of this TreeSet which contains elements less than the end element. |
boolean |
isEmpty()
Answers if this TreeSet has no elements, a size of zero. |
Iterator |
iterator()
Answers an Iterator on the elements of this TreeSet. |
java.lang.Object |
last()
Answers the last element in this TreeSet. |
boolean |
remove(java.lang.Object object)
Removes an occurrence of the specified object from this TreeSet. |
int |
size()
Answers the number of elements in this TreeSet. |
SortedSet |
subSet(java.lang.Object start,
java.lang.Object end)
Answers a SortedSet of the specified portion of this TreeSet which contains elements greater or equal to the start element but less than the end element. |
SortedSet |
tailSet(java.lang.Object start)
Answers a SortedSet of the specified portion of this TreeSet which contains elements greater or equal to the start element. |
| Methods inherited from class oracle.adfnmc.java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class oracle.adfnmc.java.util.AbstractCollection |
|---|
containsAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface oracle.adfnmc.java.util.Set |
|---|
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public TreeSet()
public TreeSet(Collection collection)
collection - the collection of elements to add
java.lang.ClassCastException - when an element in the Collection does not implement the Comparable interface, or the elements in the
Collection cannot be comparedpublic TreeSet(Comparator comparator)
comparator - the Comparatorpublic TreeSet(SortedSet set)
set - the SortedSet of elements to add| Method Detail |
|---|
public boolean add(java.lang.Object object)
add in interface Collectionadd in interface Setadd in class AbstractCollectionobject - the object to add
java.lang.ClassCastException - when the object cannot be compared with the elements in this TreeSet
java.lang.NullPointerException - when the object is null and the comparator cannot handle nullpublic boolean addAll(Collection collection)
addAll in interface CollectionaddAll in interface SetaddAll in class AbstractCollectioncollection - the Collection of objects
java.lang.ClassCastException - when an object in the Collection cannot be compared with the elements in this TreeSet
java.lang.NullPointerException - when an object in the Collection is null and the comparator cannot handle nullpublic void clear()
clear in interface Collectionclear in interface Setclear in class AbstractCollectionisEmpty(),
size()public java.lang.Object clone()
Cloneablepublic Comparator comparator()
comparator in interface SortedSetpublic boolean contains(java.lang.Object object)
contains in interface Collectioncontains in interface Setcontains in class AbstractCollectionobject - the object to search for
object is an element of this TreeSet, false otherwise
java.lang.ClassCastException - when the object cannot be compared with the elements in this TreeSet
java.lang.NullPointerException - when the object is null and the comparator cannot handle nullpublic java.lang.Object first()
first in interface SortedSetNoSuchElementException - when this TreeSet is emptypublic SortedSet headSet(java.lang.Object end)
headSet in interface SortedSetend - the end element
end
java.lang.ClassCastException - when the end object cannot be compared with the elements in this TreeSet
java.lang.NullPointerException - when the end object is null and the comparator cannot handle nullpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface SetisEmpty in class AbstractCollectionsize()public Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setiterator in class AbstractCollectionIteratorpublic java.lang.Object last()
last in interface SortedSetNoSuchElementException - when this TreeSet is emptypublic boolean remove(java.lang.Object object)
remove in interface Collectionremove in interface Setremove in class AbstractCollectionobject - the object to remove
java.lang.ClassCastException - when the object cannot be compared with the elements in this TreeSet
java.lang.NullPointerException - when the object is null and the comparator cannot handle nullpublic int size()
size in interface Collectionsize in interface Setsize in class AbstractCollection
public SortedSet subSet(java.lang.Object start,
java.lang.Object end)
subSet in interface SortedSetstart - the start elementend - the end element
start and less than end
java.lang.ClassCastException - when the start or end object cannot be compared with the elements in this TreeSet
java.lang.NullPointerException - when the start or end object is null and the comparator cannot handle nullpublic SortedSet tailSet(java.lang.Object start)
tailSet in interface SortedSetstart - the start element
start
java.lang.ClassCastException - when the start object cannot be compared with the elements in this TreeSet
java.lang.NullPointerException - when the start object is null and the comparator cannot handle null
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||