Package org.optaplanner.core.impl.heuristic.selector

## Interface IterableSelector<Solution_,​T>

- All Superinterfaces:
    `EventListener`, `Iterable<T>`, `PhaseLifecycleListener<Solution_>`, `Selector<Solution_>`, `SolverLifecycleListener<Solution_>`
  All Known Subinterfaces:
    `EntityIndependentValueSelector<Solution_>`, `EntitySelector<Solution_>`, `ListIterableSelector<Solution_,​T>`, `MoveSelector<Solution_>`, `PillarSelector<Solution_>`, `SubChainSelector<Solution_>`
  All Known Implementing Classes:
    `AbstractCachingEntitySelector`, `AbstractCachingMoveSelector`, `AbstractEntitySelector`, `AbstractMoveSelector`, `CachingEntitySelector`, `CachingMoveSelector`, `CachingValueSelector`, `CartesianProductMoveSelector`, `ChangeMoveSelector`, `CompositeMoveSelector`, `DefaultPillarSelector`, `DefaultSubChainSelector`, `EntityIndependentFilteringValueSelector`, `EntityIndependentInitializedValueSelector`, `FilteringEntitySelector`, `FilteringMoveSelector`, `FromSolutionEntitySelector`, `FromSolutionPropertyValueSelector`, `GenericMoveSelector`, `KOptMoveSelector`, `MimicRecordingEntitySelector`, `MimicRecordingValueSelector`, `MimicReplayingEntitySelector`, `MimicReplayingValueSelector`, `MoveIteratorFactoryToMoveSelectorBridge`, `MoveListFactoryToMoveSelectorBridge`, `NearEntityNearbyEntitySelector`, `PillarChangeMoveSelector`, `PillarSwapMoveSelector`, `ProbabilityEntitySelector`, `ProbabilityMoveSelector`, `ProbabilityValueSelector`, `SelectedCountLimitEntitySelector`, `SelectedCountLimitMoveSelector`, `SelectedCountLimitValueSelector`, `ShufflingEntitySelector`, `ShufflingMoveSelector`, `ShufflingValueSelector`, `SortingEntitySelector`, `SortingMoveSelector`, `SortingValueSelector`, `SubChainChangeMoveSelector`, `SubChainSwapMoveSelector`, `SwapMoveSelector`, `TailChainSwapMoveSelector`, `UnionMoveSelector`

      public interface IterableSelector<Solution_,​T>
      extends Selector<Solution_>, Iterable<T>

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `getSize()` | A random JIT `Selector` with `Selector.isNeverEnding()` true should return a size as if it would be able to return each distinct element only once, because the size can be used in `SelectionProbabilityWeightFactory`.
    `default Spliterator<T>` | `spliterator()` |

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, iterator`

    - ### Methods inherited from interface org.optaplanner.core.impl.phase.event.PhaseLifecycleListener

      `phaseEnded, phaseStarted, stepEnded, stepStarted`

    - ### Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.Selector

      `getCacheType, isCountable, isNeverEnding`

    - ### Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener

      `solvingEnded, solvingStarted`

- - ### Method Detail

    - #### getSize

          long getSize()

      A random JIT `Selector` with `Selector.isNeverEnding()` true should return a size as if it would be able to return each distinct element only once, because the size can be used in `SelectionProbabilityWeightFactory`.
      Returns:
        the approximate number of elements generated by this `Selector`, always `>= 0`
      Throws:
        `IllegalStateException` - if `Selector.isCountable()` returns false, but not if only `Selector.isNeverEnding()` returns true

    - #### spliterator

          default Spliterator<T> spliterator()

      Specified by:
        `spliterator` in interface `Iterable<Solution_>`