Class CachedListRandomIterator<S>

java.lang.Object
org.optaplanner.core.impl.heuristic.selector.common.iterator.SelectionIterator<S>
org.optaplanner.core.impl.heuristic.selector.common.iterator.CachedListRandomIterator<S>
Type Parameters:
S - Selection type, for example a Move class, an entity class or a value class.
All Implemented Interfaces:
Iterator<S>

public class CachedListRandomIterator<S> extends SelectionIterator<S>
This Iterator does not shuffle and is never ending.
  • Field Details

    • cachedList

      protected final List<S> cachedList
    • workingRandom

      protected final Random workingRandom
    • empty

      protected final boolean empty
  • Constructor Details

    • CachedListRandomIterator

      public CachedListRandomIterator(List<S> cachedList, Random workingRandom)
  • Method Details

    • hasNext

      public boolean hasNext()
    • next

      public S next()