T - the type of elements.
public interface MultiSet<T> extends Iterable<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(T key)
Test whether
key is present in this MultiSet.
|
Set |
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 |
put(T key)
Put
key to the MultiSet once.
|
void |
put(T key, int howOften)
|
void |
putAll(Collection
Put all keys contained in
key into the MultiSet once.
|
void |
remove(T key)
Remove key from the MultiSet once.
|
void |
removeAll(T key)
Remove all occurrences of
key.
|
void |
removeN(T key, int n)
Remove key from the MultiSet once.
|
forEach, iterator, spliteratorvoid put(T key)
key to the MultiSet once.
key - the element to add.
void put(T key, int howOften)
void putAll(Collection<T> keys)
key into the MultiSet once.
keys - a collection of keys.
void remove(T key)
key - the element to remove.
void removeN(T key, int n)
key - the element to remove.
n - the number of times to remove the specified element.
void removeAll(T key)
key.
key - the element to remove.
int occurences(T key)
key is present in this MultiSet.
key - the element queried.
key in this MultiSet.
boolean contains(T key)
key is present in this MultiSet.
key - the element queried.