Package eu.bandm.tools.util.multi
Class HashMultiset<A>
java.lang.Object
eu.bandm.tools.util.multi.AbstractMultiset<A>
eu.bandm.tools.util.multi.HashMultiset<A>
- Type Parameters:
A
- type of the contained elements
- 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 inherited from interface eu.bandm.tools.util.multi.Multiset
DEFAULT_MULTI_FORMAT_STRING, DEFAULT_SINGLE_FORMAT_STRING
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty multisetHashMultiset
(Multiset<? extends A> proto) Construct a multiset which contains the given elements. -
Method Summary
Methods inherited from class eu.bandm.tools.util.multi.AbstractMultiset
add, add, clear, contains, containsUnchecked, count, countAll, countAllUnchecked, countUnchecked, domain, isEmpty, iterator, remove, removeAll, removeAllUnchecked, removeDomain, removeDomainUnchecked, removeUnchecked, retainAll, retainAllUnchecked, supportMap, toString, xget
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
HashMultiset
public HashMultiset()Construct an empty multiset -
HashMultiset
Construct a multiset which contains the given elements. Both collections will be independent.- Parameters:
proto
- the initially contained elements
-
-
Method Details
-
map
Returns the supporting map. That map Realizes containment by mapping every contained object to a number greater than zero, how often it is contained in this instance.- Specified by:
map
in classAbstractMultiset<A>
- Returns:
- the supporting map.
-