Class TreeMultiSet<T>

All Implemented Interfaces:
Iterable<T>, Collection<T>, MultiSet<T>, SortedMultiSet<T>, HTMLToString

public class TreeMultiSet<T> extends AbstractMultiSet<T,TreeMap<T,Integer>> implements SortedMultiSet<T>
  • Constructor Details

    • TreeMultiSet

      public TreeMultiSet(Collection<T> collection)
      Constructs a new multiset, such that all elements of the given collection are added as many times as they are returned by the iterator of that collection. All elements inserted into the multiset must implement the Comparable interface. Furthermore, all such elements must be mutually comparable: e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in the set.
      Parameters:
      collection - Representing the objects that should be put in a multiset
    • TreeMultiSet

      public TreeMultiSet(T... collection)
      Constructs a new multiset, such that all elements of the given collection are added as many times as they are in the given array. All elements inserted into the multiset must implement the Comparable interface. Furthermore, all such elements must be mutually comparable: e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in the set.
      Parameters:
      collection - Representing the objects that should be put in a multiset
    • TreeMultiSet

      public TreeMultiSet()
      Constructs a new, empty multiset, such that all elements of the given collection are added as many times as they are returned by the iterator of that collection. All elements inserted into the multiset must implement the Comparable interface. Furthermore, all such elements must be mutually comparable: e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in the set.
    • TreeMultiSet

      public TreeMultiSet(Collection<T> collection, Comparator<? super T> comp)
      Constructs a new multiset, such that all elements of the given collection are added as many times as they are returned by the iterator of that collection.
      Parameters:
      comp - A comparator providing sorting on the elements of the multiset
      collection - Representing the objects that should be put in a multiset
    • TreeMultiSet

      public TreeMultiSet(Comparator<? super T> comp, T... collection)
      Constructs a new multiset, such that all elements of the given collection are added as many times as they are in the given array.
      Parameters:
      comp - A comparator providing sorting on the elements of the multiset
      collection - Representing the objects that should be put in a multiset
    • TreeMultiSet

      public TreeMultiSet(Comparator<? super T> comp)
      Constructs a new, empty multiset, such that all elements of the given collection are added as many times as they are returned by the iterator of that collection.
      Parameters:
      comp - A comparator providing sorting on the elements of the multiset
  • Method Details