Class FilteringEntitySelector<Solution_>
- java.lang.Object
- 
- org.optaplanner.core.impl.heuristic.selector.AbstractSelector<Solution_>
- 
- org.optaplanner.core.impl.heuristic.selector.entity.AbstractEntitySelector<Solution_>
- 
- org.optaplanner.core.impl.heuristic.selector.entity.decorator.FilteringEntitySelector<Solution_>
 
 
 
- 
- All Implemented Interfaces:
- Iterable<Object>,- EventListener,- ListIterable<Object>,- EntitySelector<Solution_>,- IterableSelector<Solution_,Object>,- ListIterableSelector<Solution_,Object>,- Selector<Solution_>,- PhaseLifecycleListener<Solution_>,- SolverLifecycleListener<Solution_>
 
 public class FilteringEntitySelector<Solution_> extends AbstractEntitySelector<Solution_> 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classFilteringEntitySelector.JustInTimeFilteringEntityIterator
 - 
Field SummaryFields Modifier and Type Field Description protected booleanbailOutEnabledprotected EntitySelector<Solution_>childEntitySelectorprotected List<SelectionFilter<Solution_,Object>>filterListprotected ScoreDirector<Solution_>scoreDirector- 
Fields inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelectorlogger, phaseLifecycleSupport, workingRandom
 
- 
 - 
Constructor SummaryConstructors Constructor Description FilteringEntitySelector(EntitySelector<Solution_> childEntitySelector, List<SelectionFilter<Solution_,Object>> filterList)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccept(ScoreDirector<Solution_> scoreDirector, Object entity)protected longdetermineBailOutSize()Iterator<Object>endingIterator()IfSelector.isNeverEnding()is true, thenIterable.iterator()will never end.EntityDescriptor<Solution_>getEntityDescriptor()longgetSize()A random JITSelectorwithSelector.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 inSelectionProbabilityWeightFactory.booleanisCountable()If false, thenSelector.isNeverEnding()is true.booleanisNeverEnding()Is true ifSelector.isCountable()is false or if this selector is in random order (for most cases).Iterator<Object>iterator()ListIterator<Object>listIterator()ListIterator<Object>listIterator(int index)voidphaseEnded(AbstractPhaseScope<Solution_> phaseScope)voidphaseStarted(AbstractPhaseScope<Solution_> phaseScope)StringtoString()- 
Methods inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelectorgetCacheType, solvingEnded, solvingStarted, stepEnded, stepStarted
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.IterableSelectorspliterator
 - 
Methods inherited from interface org.optaplanner.core.impl.phase.event.PhaseLifecycleListenerstepEnded, stepStarted
 - 
Methods inherited from interface org.optaplanner.core.impl.heuristic.selector.SelectorgetCacheType
 - 
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListenersolvingEnded, solvingStarted
 
- 
 
- 
- 
- 
Field Detail- 
childEntitySelectorprotected final EntitySelector<Solution_> childEntitySelector 
 - 
filterListprotected final List<SelectionFilter<Solution_,Object>> filterList 
 - 
bailOutEnabledprotected final boolean bailOutEnabled 
 - 
scoreDirectorprotected ScoreDirector<Solution_> scoreDirector 
 
- 
 - 
Constructor Detail- 
FilteringEntitySelectorpublic FilteringEntitySelector(EntitySelector<Solution_> childEntitySelector, List<SelectionFilter<Solution_,Object>> filterList) 
 
- 
 - 
Method Detail- 
phaseStartedpublic void phaseStarted(AbstractPhaseScope<Solution_> phaseScope) - Specified by:
- phaseStartedin interface- PhaseLifecycleListener<Solution_>
- Overrides:
- phaseStartedin class- AbstractSelector<Solution_>
 
 - 
phaseEndedpublic void phaseEnded(AbstractPhaseScope<Solution_> phaseScope) - Specified by:
- phaseEndedin interface- PhaseLifecycleListener<Solution_>
- Overrides:
- phaseEndedin class- AbstractSelector<Solution_>
 
 - 
getEntityDescriptorpublic EntityDescriptor<Solution_> getEntityDescriptor() - Returns:
- never null
 
 - 
isCountablepublic boolean isCountable() Description copied from interface:SelectorIf false, thenSelector.isNeverEnding()is true.- Returns:
- true if all the ValueRanges are countable (for example a double value range between 1.2 and 1.4 is not countable)
 
 - 
isNeverEndingpublic boolean isNeverEnding() Description copied from interface:SelectorIs true ifSelector.isCountable()is false or if this selector is in random order (for most cases). Is never true when this selector is in shuffled order (which is less scalable but more exact).- Returns:
- true if the Iterator.hasNext()of theIteratorcreated byIterable.iterator()never returns false (except when it's empty).
 
 - 
getSizepublic long getSize() Description copied from interface:IterableSelectorA random JITSelectorwithSelector.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 inSelectionProbabilityWeightFactory.- Returns:
- the approximate number of elements generated by this Selector, always>= 0
 
 - 
listIteratorpublic ListIterator<Object> listIterator() - Returns:
- never null, see List.listIterator().
- See Also:
- List.listIterator()
 
 - 
listIteratorpublic ListIterator<Object> listIterator(int index) - Parameters:
- index- lower than the size of this- ListIterable, see- List.listIterator(int).
- Returns:
- never null, see List.listIterator(int).
- See Also:
- List.listIterator()
 
 - 
endingIteratorpublic Iterator<Object> endingIterator() Description copied from interface:EntitySelectorIfSelector.isNeverEnding()is true, thenIterable.iterator()will never end. This returns an endingIterator, that tries to matchIterable.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 thisEntitySelectorentirely.- Returns:
- never null
- See Also:
- Iterable.iterator()
 
 - 
determineBailOutSizeprotected long determineBailOutSize() 
 - 
acceptprotected boolean accept(ScoreDirector<Solution_> scoreDirector, Object entity) 
 
- 
 
-