T - the type of elements.
public interface MultiSet<T> extends Iterable<T>
| Modifier and Type | Method and Description |
|---|---|
void |
add(T key)
Put
key to the MultiSet once.
|
void |
add(T key, int n)
|
void |
addAll(Collection
Put all keys contained in
key into the MultiSet once.
|
void |
addAll(Collection
|
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 |
remove(T key)
Remove key from the MultiSet once.
|
void |
removeAll(Collection
|
void |
removeAllN(Collection
|
void |
removeAllOccurences(Collection
|
void |
removeN(T key, int n)
Remove key from the MultiSet once.
|
void |
removeOccurences(T key)
Remove all occurrences of
key.
|
forEach, iterator, spliteratorvoid add(T key)
key to the MultiSet once.
key - the element to add.
void add(T key, int n)
void addAll(Collection<T> keys)
key into the MultiSet once.
keys - a collection of keys.
void addAll(Collection<T> keys, int n)
void remove(T key)
key - the element to remove.
void removeAll(Collection<? extends T> key)
void removeN(T key, int n)
key - the element to remove.
n - the number of times to remove the specified element.
void removeAllN(Collection<? extends T> key, int n)
void removeOccurences(T key)
key.
key - the element to remove.
void removeAllOccurences(Collection<? extends T> key)
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.