java.util
Class TreeSet

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--java.util.TreeSet
All Implemented Interfaces:
Cloneable, Collection, Serializable, Set, SortedSet

public synchronized class TreeSet
extends AbstractSet
implements SortedSet, Cloneable, Serializable

See Also:
Serialized Form

Constructor Summary
TreeSet()
           
TreeSet(Collection)
           
TreeSet(Comparator)
           
TreeSet(SortedSet)
           
 
Method Summary
 boolean add(Object)
           
 boolean addAll(Collection)
           
 void clear()
           
 Object clone()
           
 Comparator comparator()
           
 boolean contains(Object)
           
 Object first()
           
 SortedSet headSet(Object)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 Object last()
           
 boolean remove(Object)
           
 int size()
           
 SortedSet subSet(Object, Object)
           
 SortedSet tailSet(Object)
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

TreeSet

public TreeSet()

TreeSet

public TreeSet(Comparator)

TreeSet

public TreeSet(Collection)

TreeSet

public TreeSet(SortedSet)
Method Detail

iterator

public Iterator iterator()
Specified by:
iterator in interface Set
Specified by:
iterator in class AbstractCollection

size

public int size()
Specified by:
size in interface Set
Specified by:
size in class AbstractCollection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Set
Overrides:
isEmpty in class AbstractCollection

contains

public boolean contains(Object)
Specified by:
contains in interface Set
Overrides:
contains in class AbstractCollection

add

public boolean add(Object)
Specified by:
add in interface Set
Overrides:
add in class AbstractCollection

remove

public boolean remove(Object)
Specified by:
remove in interface Set
Overrides:
remove in class AbstractCollection

clear

public void clear()
Specified by:
clear in interface Set
Overrides:
clear in class AbstractCollection

addAll

public boolean addAll(Collection)
Specified by:
addAll in interface Set
Overrides:
addAll in class AbstractCollection

subSet

public SortedSet subSet(Object,
                        Object)
Specified by:
subSet in interface SortedSet

headSet

public SortedSet headSet(Object)
Specified by:
headSet in interface SortedSet

tailSet

public SortedSet tailSet(Object)
Specified by:
tailSet in interface SortedSet

comparator

public Comparator comparator()
Specified by:
comparator in interface SortedSet

first

public Object first()
Specified by:
first in interface SortedSet

last

public Object last()
Specified by:
last in interface SortedSet

clone

public Object clone()