|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.util.HashSetMulti<V>
public class HashSetMulti<V>
A hash "set" that objects can be added to multiple times. An object must be
removed an equal number of times before it disappears.
This class is to HashMapMulti as HashSet
is to HashMap, but note that it does not truly implement the set
abstraction since the number of times a value is entered is significant.
| Constructor Summary | |
|---|---|
HashSetMulti()
Construct a new, empty set. |
|
| Method Summary | ||
|---|---|---|
void |
add(V obj)
Add an object to the set. |
|
HashSetMulti<V> |
asUnmodifiable()
Produce a new set that is a read-only version of this one. |
|
boolean |
contains(V obj)
Test if a given object is a member of the set (i.e., that it has been added more times than it has been removed). |
|
static
|
emptySet()
Produce an empty set. |
|
boolean |
isEmpty()
Test if this set is empty. |
|
Iterator<V> |
iterator()
Obtain an iterator over the objects in this set (not repeating multiples). |
|
void |
remove(V obj)
Remove an object from the set. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HashSetMulti()
| Method Detail |
|---|
public void add(V obj)
obj - The object to add.public HashSetMulti<V> asUnmodifiable()
public boolean contains(V obj)
obj - The object to test for.
public static <V> HashSetMulti<V> emptySet()
public boolean isEmpty()
public Iterator<V> iterator()
iterator in interface Iterable<V>public void remove(V obj)
obj - The object to remove.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||