|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.Collections.PersistentSet
PersistentSet
implements a persistent set, based on a
binary search tree.
Constructor Summary | |
PersistentSet()
Creates an empty PersistentSet whose member objects
will all implement java.lang.Comparable . |
|
PersistentSet(Comparator c)
Creates an empty PersistentSet whose member objects
are ordered by the given Comparator . |
Method Summary | |
PersistentSet |
add(Object element)
Creates and returns a new PersistantSet identical to
this one, except it contains element . |
Set |
asSet()
java.util.Collection s view of the set. |
boolean |
contains(Object element)
Determines if the given element belongs to this set. |
boolean |
isEmpty()
Determines if this PersistentSet has any members. |
PersistentSet |
remove(Object element)
Make a new PersistentSet identical to this one,
except that it does not contain element . |
int |
size()
Count the number of elements in this PersistentSet . |
String |
toString()
Human-readable representation of the set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PersistentSet()
PersistentSet
whose member objects
will all implement java.lang.Comparable
.
public PersistentSet(Comparator c)
PersistentSet
whose member objects
are ordered by the given Comparator
.
Method Detail |
public boolean isEmpty()
PersistentSet
has any members.
public int size()
PersistentSet
.
public PersistentSet add(Object element)
PersistantSet
identical to
this one, except it contains element
.
public boolean contains(Object element)
public PersistentSet remove(Object element)
PersistentSet
identical to this one,
except that it does not contain element
.
public String toString()
toString
in class Object
public Set asSet()
java.util.Collection
s view of the set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |