Interface Multiset<A>

All Superinterfaces:
Iterable<A>, Serializable
All Known Subinterfaces:
SortedMultiset<A>
All Known Implementing Classes:
HashMultiset, TreeMultiset, UnmodifiableMultiset

public interface Multiset<A> extends Iterable<A>, Serializable
Structure similar to a set, but every element can be contained more than once. Corresponds to a map from the domain type into natural numbers (including ß).
  • Method Details

    • isEmpty

      boolean isEmpty()
    • clear

      void clear()
    • add

      boolean add(A a)
      Returns:
      whether the Multiset has been changed. Is defined only for a better analogy to the philosophy of java.util.Collection, but indeed returns always true.
    • add

      boolean add(A a, int i)
    • contains

      boolean contains(A a)
    • containsUnchecked

      boolean containsUnchecked(Object a)
    • remove

      boolean remove(A a)
    • removeUnchecked

      boolean removeUnchecked(Object a)
    • removeDomain

      boolean removeDomain(A a)
    • removeDomainUnchecked

      boolean removeDomainUnchecked(Object a)
    • removeAll

      boolean removeAll(Collection<? extends A> c)
    • removeAllUnchecked

      boolean removeAllUnchecked(Collection<?> c)
    • retainAll

      boolean retainAll(Collection<? extends A> c)
    • retainAllUnchecked

      boolean retainAllUnchecked(Collection<?> c)
    • domain

      Set<A> domain()
      domain().equals(supportMap().keySet())
    • supportMap

      Map<A,Integer> supportMap()
      ATTENTION assume no Map.Entry.getValue()==0 is in map, but domain key is removed in case that count == 0.
    • count

      int count(A a)
    • countUnchecked

      int countUnchecked(Object a)
    • countAll

      int countAll(Collection<? extends A> a)
    • countAllUnchecked

      int countAllUnchecked(Collection<?> a)