Interface Multiset<E>

Type Parameters:
E - the element type
All Superinterfaces:
Collection<E>, Iterable<E>
All Known Implementing Classes:
HashMultiset

public interface Multiset<E> extends Collection<E>
A collection which permits duplicates, and provides methods adding/removing several counts of an element.
  • Method Details

    • add

      void add(E element, int n)
      Add n counts of an element.
      Parameters:
      element - the element to add
      n - how many to add
    • remove

      int remove(Object element, int n)
      Remove up to n counts of an element.
      Parameters:
      element - the element the remove
      n - how many to remove
      Returns:
      the number of elements removed
    • count

      int count(Object element)
    • getDistinctElements

      Set<E> getDistinctElements()