T - the class of the elements of this multi-set.public final class HashMultiSet<T> extends AbstractMultiSet<Map<T,MultiSet.Multiplicity>,T> implements MultiSet<T>
HashMap.
Mathematically this is something between a set and a family.
Note that this kind of set does support null elements.AbstractMultiSet.MultiplicityImpl, AbstractMultiSet.MultiSetIteratorImpl<T>MultiSet.Multiplicityobj2mult| Modifier | Constructor and Description |
|---|---|
|
HashMultiSet()
Creates a new, empty
MultiSet. |
private |
HashMultiSet(Map<T,MultiSet.Multiplicity> t2mult) |
|
HashMultiSet(MultiSet<? extends T> other)
Copy constructor.
|
|
HashMultiSet(Set<? extends T> sSet)
Creates a multi set with the elements of
sSet
and all elements with multiplicity 1. |
| Modifier and Type | Method and Description |
|---|---|
Map<T,MultiSet.Multiplicity> |
getMap()
Returns a view of the underlying map of this
MultiSet
as a map mapping each entry to its multiplicity. |
Set<T> |
getSet()
Returns a view of the underlying set of this
MultiSet. |
String |
toString() |
add, addAll, addAll, addWithMult, addWithMult, clear, contains, containsAll, equals, getMaxMult, getMultiplicity, getMultiplicityObj, getObjWithMaxMult, getSetWithMults, hashCode, isEmpty, iterator, remove, removeAll, removeWithMult, removeWithMult, retainAll, setMultiplicity, size, sizeWithMult, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, addAll, addWithMult, addWithMult, clear, contains, containsAll, equals, getMaxMult, getMultiplicity, getMultiplicityObj, getObjWithMaxMult, getSetWithMults, hashCode, isEmpty, iterator, remove, removeAll, removeWithMult, removeWithMult, retainAll, setMultiplicity, size, sizeWithMult, toArray, toArrayforEach, spliteratorprivate HashMultiSet(Map<T,MultiSet.Multiplicity> t2mult)
public HashMultiSet()
MultiSet.public HashMultiSet(MultiSet<? extends T> other)
other - another MultiSet instance.public Set<T> getSet()
MultiSet.
For certain implementations, this set is immutable
to prevent implicit modification of this MultiSet.public Map<T,MultiSet.Multiplicity> getMap()
MultiSet
as a map mapping each entry to its multiplicity.Copyright © 2012–2018 Simuline Organization (l2r). All rights reserved.