Class DowncastingValueSelector
- java.lang.Object
- 
- org.optaplanner.core.impl.heuristic.selector.AbstractSelector
- 
- org.optaplanner.core.impl.heuristic.selector.value.AbstractValueSelector
- 
- org.optaplanner.core.impl.heuristic.selector.value.decorator.DowncastingValueSelector
 
 
 
- 
- All Implemented Interfaces:
- EventListener,- Selector,- ValueSelector,- PhaseLifecycleListener,- SolverLifecycleListener
 
 public class DowncastingValueSelector extends AbstractValueSelector 
- 
- 
Field SummaryFields Modifier and Type Field Description protected ValueSelectorchildValueSelectorprotected Class<?>downcastEntityClass- 
Fields inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelectorlogger, phaseLifecycleSupport, workingRandom
 
- 
 - 
Constructor SummaryConstructors Constructor Description DowncastingValueSelector(ValueSelector childValueSelector, Class<?> downcastEntityClass)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<Object>endingIterator(Object entity)IfSelector.isNeverEnding()is true, thenValueSelector.iterator(Object)will never end.ValueSelectorgetChildValueSelector()longgetSize(Object entity)Similar toIterableSelector.getSize(), but requires an entity.GenuineVariableDescriptorgetVariableDescriptor()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(Object entity)Similar toIterable.iterator(), but requires an entity.StringtoString()- 
Methods inherited from class org.optaplanner.core.impl.heuristic.selector.AbstractSelectorgetCacheType, phaseEnded, phaseStarted, 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.phase.event.PhaseLifecycleListenerphaseEnded, phaseStarted, stepEnded, 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- 
childValueSelectorprotected final ValueSelector childValueSelector 
 - 
downcastEntityClassprotected final Class<?> downcastEntityClass 
 
- 
 - 
Constructor Detail- 
DowncastingValueSelectorpublic DowncastingValueSelector(ValueSelector childValueSelector, Class<?> downcastEntityClass) 
 
- 
 - 
Method Detail- 
getChildValueSelectorpublic ValueSelector getChildValueSelector() 
 - 
getVariableDescriptorpublic GenuineVariableDescriptor getVariableDescriptor() - 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(Object entity) Description copied from interface:ValueSelectorSimilar toIterableSelector.getSize(), but requires an entity.- Parameters:
- entity- never null
- Returns:
- the approximate number of elements generated by this Selector, always>= 0
 
 - 
iteratorpublic Iterator<Object> iterator(Object entity) Description copied from interface:ValueSelectorSimilar toIterable.iterator(), but requires an entity.- Parameters:
- entity- never null
- Returns:
- never null
 
 - 
endingIteratorpublic Iterator<Object> endingIterator(Object entity) Description copied from interface:ValueSelectorIfSelector.isNeverEnding()is true, thenValueSelector.iterator(Object)will never end. This returns an endingIterator, that tries to matchValueSelector.iterator(Object)as much as possible, but return each distinct element only once and therefore it might not respect the configuration of thisValueSelectorentirely.- Parameters:
- entity- never null
- Returns:
- never null
- See Also:
- ValueSelector.iterator(Object)
 
 
- 
 
-