net.sf.colossus.util
Class MultiSet<T>
java.lang.Object
net.sf.colossus.util.MultiSet<T>
public class MultiSet<T>
- extends java.lang.Object
Class MultiSet is a set that can contain more than one of the same
element, built around a HashMap that maps objects to Integer counts.
Field Summary |
private java.util.Map<T,java.lang.Integer> |
map
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
map
private final java.util.Map<T,java.lang.Integer> map
MultiSet
public MultiSet()
add
public void add(T key)
remove
public boolean remove(T key)
- Remove one of key from the set, if present. Return true iff it
was present.
size
public int size()
contains
public boolean contains(T key)
count
public int count(T key)
keySet
public java.util.Collection<T> keySet()
values
public java.util.Collection<java.lang.Integer> values()
isEmpty
public boolean isEmpty()
max
public int max()