Class CompositeValueRangeDescriptor<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.domain.valuerange.descriptor.AbstractValueRangeDescriptor<Solution_>
-
- org.optaplanner.core.impl.domain.valuerange.descriptor.CompositeValueRangeDescriptor<Solution_>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Implemented Interfaces:
EntityIndependentValueRangeDescriptor<Solution_>,ValueRangeDescriptor<Solution_>
public class CompositeValueRangeDescriptor<Solution_> extends AbstractValueRangeDescriptor<Solution_> implements EntityIndependentValueRangeDescriptor<Solution_>
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ValueRangeDescriptor<Solution_>>childValueRangeDescriptorListprotected booleanentityIndependent-
Fields inherited from class org.optaplanner.core.impl.domain.valuerange.descriptor.AbstractValueRangeDescriptor
addNullInValueRange, variableDescriptor
-
-
Constructor Summary
Constructors Constructor Description CompositeValueRangeDescriptor(GenuineVariableDescriptor<Solution_> variableDescriptor, boolean addNullInValueRange, List<ValueRangeDescriptor<Solution_>> childValueRangeDescriptorList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueRange<?>extractValueRange(Solution_ solution)As specified byValueRangeDescriptor.extractValueRange(Solution_, java.lang.Object).ValueRange<?>extractValueRange(Solution_ solution, Object entity)booleanisCountable()booleanisEntityIndependent()If this method return true, this instance is safe to cast toEntityIndependentValueRangeDescriptor, otherwise it requires an entity to determine theValueRange.-
Methods inherited from class org.optaplanner.core.impl.domain.valuerange.descriptor.AbstractValueRangeDescriptor
doNullInValueRangeWrapping, getVariableDescriptor, mightContainEntity, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.impl.domain.valuerange.descriptor.ValueRangeDescriptor
getVariableDescriptor, mightContainEntity
-
-
-
-
Field Detail
-
childValueRangeDescriptorList
protected final List<ValueRangeDescriptor<Solution_>> childValueRangeDescriptorList
-
entityIndependent
protected boolean entityIndependent
-
-
Constructor Detail
-
CompositeValueRangeDescriptor
public CompositeValueRangeDescriptor(GenuineVariableDescriptor<Solution_> variableDescriptor, boolean addNullInValueRange, List<ValueRangeDescriptor<Solution_>> childValueRangeDescriptorList)
-
-
Method Detail
-
isCountable
public boolean isCountable()
- Specified by:
isCountablein interfaceValueRangeDescriptor<Solution_>- Returns:
- true if the
ValueRangeis countable (for example a double value range between 1.2 and 1.4 is not countable)
-
isEntityIndependent
public boolean isEntityIndependent()
Description copied from interface:ValueRangeDescriptorIf this method return true, this instance is safe to cast toEntityIndependentValueRangeDescriptor, otherwise it requires an entity to determine theValueRange.- Specified by:
isEntityIndependentin interfaceValueRangeDescriptor<Solution_>- Returns:
- true if the
ValueRangeis the same for all entities of the same solution
-
extractValueRange
public ValueRange<?> extractValueRange(Solution_ solution, Object entity)
- Specified by:
extractValueRangein interfaceValueRangeDescriptor<Solution_>- Parameters:
solution- never nullentity- never null. To avoid this parameter, useEntityIndependentValueRangeDescriptor.extractValueRange(Solution_)instead.- Returns:
- never null
-
extractValueRange
public ValueRange<?> extractValueRange(Solution_ solution)
Description copied from interface:EntityIndependentValueRangeDescriptorAs specified byValueRangeDescriptor.extractValueRange(Solution_, java.lang.Object).- Specified by:
extractValueRangein interfaceEntityIndependentValueRangeDescriptor<Solution_>- Parameters:
solution- never null- Returns:
- never null
- See Also:
ValueRangeDescriptor.extractValueRange(Solution_, java.lang.Object)
-
-