Class GenericSetsPickN<T>

  • All Implemented Interfaces:
    java.util.Iterator<java.util.Map<T,​java.lang.Integer>>

    public final class GenericSetsPickN<T>
    extends java.lang.Object
    implements java.util.Iterator<java.util.Map<T,​java.lang.Integer>>
    Author:
    Michael Weiss
    • Constructor Summary

      Constructors 
      Constructor Description
      GenericSetsPickN​(java.util.Map<T,​java.lang.Integer> maxQuantities, int target)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      java.util.Map<T,​java.lang.Integer> next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • GenericSetsPickN

        public GenericSetsPickN​(java.util.Map<T,​java.lang.Integer> maxQuantities,
                                int target)
        Parameters:
        maxQuantities - The maximum quantities per type to be returned. The iterator of this map has to return the keys in increasing order of priority
        target - how many items should be picked in total
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
        See Also:
        Iterator.hasNext()
      • next

        public java.util.Map<T,​java.lang.Integer> next()
        Specified by:
        next in interface java.util.Iterator<T>
        See Also:
        Iterator.next()