|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweiss.util.AbstractCollection<AnyType>
weiss.util.HashSet<AnyType>
public class HashSet<AnyType>
HashSet implementation. Matches are based on equals; and hashCode must be consistently defined.
Constructor Summary | |
---|---|
HashSet()
Construct an empty HashSet. |
|
HashSet(Collection<? extends AnyType> other)
Construct a HashSet from any collection. |
Method Summary | |
---|---|
boolean |
add(AnyType 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. |
AnyType |
getMatch(AnyType x)
This method is not part of standard Java. |
Iterator<AnyType> |
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, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface weiss.util.Collection |
---|
isEmpty, toArray, toArray |
Constructor Detail |
---|
public HashSet()
public HashSet(Collection<? extends AnyType> other)
Method Detail |
---|
public int size()
size
in interface Collection<AnyType>
public AnyType getMatch(AnyType x)
getMatch
in interface Set<AnyType>
x
- the object to search for.
public boolean contains(java.lang.Object x)
contains
in interface Collection<AnyType>
contains
in class AbstractCollection<AnyType>
x
- any object.
public boolean add(AnyType x)
add
in interface Collection<AnyType>
add
in class AbstractCollection<AnyType>
x
- any object.
public boolean remove(java.lang.Object x)
remove
in interface Collection<AnyType>
remove
in class AbstractCollection<AnyType>
x
- any object.
public void clear()
clear
in interface Collection<AnyType>
clear
in class AbstractCollection<AnyType>
public Iterator<AnyType> iterator()
iterator
in interface java.lang.Iterable<AnyType>
iterator
in interface Collection<AnyType>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |