Class TreeMultiSet<T>

    • Constructor Summary

      Constructors 
      Constructor Description
      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.
      TreeMultiSet​(java.util.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.
      TreeMultiSet​(java.util.Collection<T> collection, java.util.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.
      TreeMultiSet​(java.util.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.
      TreeMultiSet​(java.util.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.
      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.
    • Constructor Detail

      • TreeMultiSet

        public TreeMultiSet​(java.util.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​(java.util.Collection<T> collection,
                            java.util.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​(java.util.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​(java.util.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 Detail

      • baseSet

        public java.util.SortedSet<T> baseSet()
        returns an unmodifiable set of unique objects in the multiset.
        Specified by:
        baseSet in interface MultiSet<T>
        Specified by:
        baseSet in interface SortedMultiSet<T>
        Overrides:
        baseSet in class AbstractMultiSet<T,​java.util.TreeMap<T,​java.lang.Integer>>
        Returns:
        an unmodifiable set of unique objects in the multiset.