Package eu.bandm.tools.ops
Class HashMultiset<A>
java.lang.Object
eu.bandm.tools.ops.HashMultiset<A>
- All Implemented Interfaces:
Multiset<A>,Serializable,Iterable<A>
Implementation for domains with no default order,
where
TreeMultiset is not applicable.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoidclear()booleanIff get(a)>0!booleanintintcountAll(Collection<? extends A> c) intcountAllUnchecked(Collection<?> c) intdomain()domain().equals(supportMap().keySet())booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<? extends A> c) booleanremoveAllUnchecked(Collection<?> c) booleanremoveDomain(A a) booleanbooleanbooleanretainAll(Collection<? extends A> c) booleanretainAllUnchecked(Collection<?> c) The realizing peer.toString()protected intMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
map
-
-
Constructor Details
-
HashMultiset
public HashMultiset() -
HashMultiset
-
-
Method Details
-
supportMap
Description copied from interface:MultisetThe realizing peer. ATTENTION assume no Map.Entry.getValue()==0 is in map, but domain key is removed in case that count == 0.- Specified by:
supportMapin interfaceMultiset<A>
-
domain
Description copied from interface:Multisetdomain().equals(supportMap().keySet()) -
isEmpty
public boolean isEmpty() -
clear
public void clear() -
xget
-
add
-
add
-
contains
Iff get(a)>0! -
containsUnchecked
- Specified by:
containsUncheckedin interfaceMultiset<A>
-
remove
-
removeUnchecked
- Specified by:
removeUncheckedin interfaceMultiset<A>
-
removeDomain
- Specified by:
removeDomainin interfaceMultiset<A>
-
removeDomainUnchecked
- Specified by:
removeDomainUncheckedin interfaceMultiset<A>
-
removeAll
-
removeAllUnchecked
- Specified by:
removeAllUncheckedin interfaceMultiset<A>
-
retainAll
-
retainAllUnchecked
- Specified by:
retainAllUncheckedin interfaceMultiset<A>
-
count
-
countUnchecked
- Specified by:
countUncheckedin interfaceMultiset<A>
-
countAll
-
countAllUnchecked
- Specified by:
countAllUncheckedin interfaceMultiset<A>
-
iterator
-
toString
-