Class Multiset<T>

  • Type Parameters:
    T - element type

    public class Multiset<T>
    extends java.lang.Object
    Naive HashMultiset.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<T,​java.lang.Long> map  
    • Constructor Summary

      Constructors 
      Constructor Description
      Multiset()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T t)  
      void add​(T key, long count)  
      long count​(T key)  
      java.util.Collection<T> keys()  
      void merge​(Multiset<T> other)  
      long size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • map

        private final java.util.Map<T,​java.lang.Long> map
    • Constructor Detail

      • Multiset

        public Multiset()
    • Method Detail

      • add

        public void add​(T t)
      • add

        public void add​(T key,
                        long count)
      • count

        public long count​(T key)
      • keys

        public java.util.Collection<T> keys()
      • size

        public long size()
      • merge

        public void merge​(Multiset<T> other)