Constructor and Description |
---|
HashMultiSet() |
HashMultiSet(MultiSet<T> prototype) |
Modifier and Type | Method and Description |
---|---|
void |
add(T key)
Put
key to the MultiSet once. |
void |
add(T key,
int howOften) |
void |
addAll(Collection<T> keys)
Put all keys contained in
key into the MultiSet once. |
void |
addAll(Collection<T> keys,
int howOften) |
boolean |
contains(T key)
Test whether
key is present in this MultiSet. |
Iterator<T> |
iterator() |
Set<T> |
keySet()
Get the set of keys in this MultiSet.
|
int |
occurences(T key)
Get the number of times the element
key is present in this
MultiSet. |
void |
remove(T key)
Remove
key from the MultiSet once. |
void |
removeAll(Collection<? extends T> c) |
void |
removeAllN(Collection<? extends T> c,
int n) |
void |
removeAllOccurences(Collection<? extends T> c) |
void |
removeN(T key,
int n)
Remove key from the MultiSet once.
|
void |
removeOccurences(T key)
Remove all occurrences of
key . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public boolean contains(T key)
MultiSet
key
is present in this MultiSet.public int occurences(T key)
MultiSet
key
is present in this
MultiSet.occurences
in interface MultiSet<T>
key
- the element queried.key
in this MultiSet.public void add(T key)
MultiSet
key
to the MultiSet once.public void addAll(Collection<T> keys)
MultiSet
key
into the MultiSet once.public void addAll(Collection<T> keys, int howOften)
public void remove(T key)
MultiSet
key
from the MultiSet once.public void removeAll(Collection<? extends T> c)
public void removeOccurences(T key)
MultiSet
key
.removeOccurences
in interface MultiSet<T>
key
- the element to remove.public void removeAllOccurences(Collection<? extends T> c)
removeAllOccurences
in interface MultiSet<T>
public void removeN(T key, int n)
MultiSet
public void removeAllN(Collection<? extends T> c, int n)
removeAllN
in interface MultiSet<T>
public Set<T> keySet()
MultiSet