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

## Interface EntitySelector<Solution_>

- All Superinterfaces:
    `EventListener`, `Iterable<Object>`, `IterableSelector<Solution_,​Object>`, `ListIterable<Object>`, `ListIterableSelector<Solution_,​Object>`, `PhaseLifecycleListener<Solution_>`, `Selector<Solution_>`, `SolverLifecycleListener<Solution_>`
  All Known Implementing Classes:
    `AbstractCachingEntitySelector`, `AbstractEntitySelector`, `CachingEntitySelector`, `FilteringEntitySelector`, `FromSolutionEntitySelector`, `MimicRecordingEntitySelector`, `MimicReplayingEntitySelector`, `NearEntityNearbyEntitySelector`, `ProbabilityEntitySelector`, `SelectedCountLimitEntitySelector`, `ShufflingEntitySelector`, `SortingEntitySelector`

      public interface EntitySelector<Solution_>
      extends ListIterableSelector<Solution_,​Object>

  Selects instances of 1 `PlanningEntity` annotated class.
  See Also:
    `AbstractEntitySelector`, `FromSolutionEntitySelector`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Iterator<Object>` | `endingIterator()` | If `Selector.isNeverEnding()` is true, then `Iterable.iterator()` will never end.
    `EntityDescriptor<Solution_>` | `getEntityDescriptor()` |

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

      `forEach, iterator`

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

      `getSize, spliterator`

    - ### Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.common.iterator.ListIterable

      `listIterator, listIterator`

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

    - #### getEntityDescriptor

          EntityDescriptor<Solution_> getEntityDescriptor()

      Returns:
        never null

    - #### endingIterator

          Iterator<Object> endingIterator()

      If `Selector.isNeverEnding()` is true, then `Iterable.iterator()` will never end. This returns an ending `Iterator`, that tries to match `Iterable.iterator()` as much as possible, but returns each distinct element only once and returns every element that might possibly be selected and therefore it might not respect the configuration of this `EntitySelector` entirely.
      Returns:
        never null
      See Also:
        `Iterable.iterator()`