org.optaplanner.core.impl.heuristic.selector.common.iterator

## 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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<S>` | `cachedList`
    `protected boolean` | `empty`
    `protected Random` | `workingRandom`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CachedListRandomIterator(List<S> cachedList, Random workingRandom)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `S` | `next()`

    - ### Methods inherited from class org.optaplanner.core.impl.heuristic.selector.common.iterator.SelectionIterator

      `remove`

    - ### 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`

- - ### Field Detail

    - #### cachedList

          protected final List<S> cachedList

    - #### workingRandom

          protected final Random workingRandom

    - #### empty

          protected final boolean empty

  - ### Constructor Detail

    - #### CachedListRandomIterator

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

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

    - #### next

          public S next()

Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.