|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weiss.util.AbstractCollection | +--weiss.util.HashSet
HashSet implementation. Matches are based on equals; and hashCode must be consistently defined.
Constructor Summary | |
HashSet()
Construct an empty HashSet. |
|
HashSet(Collection other)
Construct a HashSet from any collection. |
Method Summary | |
boolean |
add(java.lang.Object x)
Adds an item to this collection. |
void |
clear()
Change the size of this collection to zero. |
boolean |
contains(java.lang.Object x)
Tests if some item is in this collection. |
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. |
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 HashSet()
public HashSet(Collection other)
Method Detail |
public int size()
size
in interface Collection
public java.lang.Object getMatch(java.lang.Object x)
getMatch
in interface Set
x
- the object to search for.public boolean contains(java.lang.Object x)
contains
in interface Collection
contains
in class AbstractCollection
x
- any object.public boolean add(java.lang.Object x)
add
in interface Collection
x
- any object.public boolean remove(java.lang.Object x)
remove
in interface Collection
remove
in class AbstractCollection
x
- any object.public void clear()
clear
in interface Collection
clear
in class AbstractCollection
public Iterator iterator()
iterator
in interface Collection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |