| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
  |
  +--weiss.util.AbstractCollection
        |
        +--weiss.util.TreeSet
Balanced search tree implementation of SortedSet. Matches are based on comparator or compareTo.
| Constructor Summary | |
TreeSet()
Construct an empty TreeSet.  | 
|
TreeSet(Collection other)
Construct a TreeSet from any collection.  | 
|
TreeSet(Comparator c)
Construct an empty TreeSet with a specified comparator.  | 
|
TreeSet(TreeSet other)
Construct a TreeSet from another TreeSet.  | 
|
| Method Summary | |
 boolean | 
add(java.lang.Object x)
Adds an item to this collection.  | 
 void | 
clear()
Change the size of this collection to zero.  | 
 Comparator | 
comparator()
Return the comparator used by this TreeSet.  | 
 boolean | 
contains(java.lang.Object x)
Tests if some item is in this collection.  | 
 java.lang.Object | 
first()
Find the smallest item in the set.  | 
 java.lang.Object | 
getMatch(java.lang.Object x)
This method is not part of standard Java 1.2.  | 
 Iterator | 
iterator()
Obtains an Iterator object used to traverse the collection.  | 
 java.lang.Object | 
last()
Find the largest item in the set.  | 
 boolean | 
remove(java.lang.Object x)
Removes an item from this collection.  | 
 int | 
size()
Returns the number of items in this collection.  | 
| Methods inherited from class weiss.util.AbstractCollection | 
equals, hashCode, isEmpty, toArray | 
| Methods inherited from class java.lang.Object | 
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface weiss.util.Collection | 
isEmpty, toArray | 
| Constructor Detail | 
public TreeSet()
public TreeSet(Comparator c)
public TreeSet(TreeSet other)
public TreeSet(Collection other)
| Method Detail | 
public Comparator comparator()
comparator in interface SortedSetpublic int size()
size in interface Collectionpublic java.lang.Object first()
first in interface SortedSetNoSuchElementException - if the set is empty.public java.lang.Object last()
last in interface SortedSetNoSuchElementException - if the set is empty.public java.lang.Object getMatch(java.lang.Object x)
getMatch in interface Setx - the object to search for.public boolean contains(java.lang.Object x)
contains in interface Collectioncontains in class AbstractCollectionx - any object.public boolean add(java.lang.Object x)
add in interface Collectionx - any object.public boolean remove(java.lang.Object x)
remove in interface Collectionremove in class AbstractCollectionx - any object.public void clear()
clear in interface Collectionclear in class AbstractCollectionpublic Iterator iterator()
iterator in interface Collection
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||