ahc.collection
Interface MultiSet
- All Superinterfaces:
- Collection, java.util.Collection, Set, java.util.Set
- All Known Implementing Classes:
- GenericMultiSet
- public interface MultiSet
- extends Set
This is a set that, while ensuring uniqueness of its elements, maintains a count of "how many"
of each element there are. So if an element A is added five times to the set, the MultiSet
contains it, and getCount returns 5 for it.
If removeSingle is then called for this element, the element is still contained by the set,
but getCount returns 4. Calling remove on the other hand results in the element not being
contained in the set any more.
- Author:
- Arno Haase
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
getCount
public int getCount(java.lang.Object o)
removeSingle
public boolean removeSingle(java.lang.Object o)
addAll
public void addAll(MultiSet m)
removeAll
public void removeAll(MultiSet m)
removeAllSingle
public boolean removeAllSingle(java.util.Collection c)