Class Bag<E>


  • public class Bag<E>
    extends java.lang.Object
    Simple implementation of a Bag
    Author:
    pugh
    • Constructor Summary

      Constructors 
      Constructor Description
      Bag()  
      Bag​(java.util.Map<E,​java.lang.Integer> map)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(E e)  
      boolean add​(E e, int count)  
      java.util.Collection<java.util.Map.Entry<E,​java.lang.Integer>> entrySet()  
      int getCount​(E e)  
      java.util.Set<E> keySet()  
      • Methods inherited from class java.lang.Object

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

      • Bag

        public Bag()
      • Bag

        public Bag​(java.util.Map<E,​java.lang.Integer> map)
    • Method Detail

      • add

        public boolean add​(E e)
      • add

        public boolean add​(E e,
                           int count)
      • keySet

        public java.util.Set<E> keySet()
      • entrySet

        public java.util.Collection<java.util.Map.Entry<E,​java.lang.Integer>> entrySet()
      • getCount

        public int getCount​(E e)