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>

public class HashMultiset<A> extends AbstractMultiset<A>
Implementation for domains with no default order, where TreeMultiset is not applicable.
See Also:
  • Constructor Details

    • HashMultiset

      public HashMultiset()
      Construct an empty multiset
    • HashMultiset

      public HashMultiset(Multiset<? extends A> proto)
      Construct a multiset which contains the given elements. Both collections will be independent.
      Parameters:
      proto - the initially contained elements
  • Method Details

    • map

      protected Map<A,Integer> 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 class AbstractMultiset<A>
      Returns:
      the supporting map.