Interface ValueRange<T>
- 
- All Known Subinterfaces:
- CountableValueRange<T>
 - All Known Implementing Classes:
- AbstractCountableValueRange,- AbstractUncountableValueRange,- BigDecimalValueRange,- BigIntegerValueRange,- BooleanValueRange,- CompositeCountableValueRange,- DoubleValueRange,- EmptyValueRange,- IntValueRange,- ListValueRange,- LongValueRange,- NullableCountableValueRange,- TemporalValueRange
 
 public interface ValueRange<T>A ValueRange is a set of a values for aPlanningVariable. These values might be stored in memory as aCollection(usually aListorSet), but if the values are numbers, they can also be stored in memory by their bounds to use less memory and provide more opportunities.Prefer using CountableValueRange(which extends this interface) whenever possible.A ValueRange is stateful (unlike a ValueSelectorwhich is stateless).Implementations must be immutable. An implementation must extend AbstractCountableValueRangeorAbstractUncountableValueRangeto ensure backwards compatibility in future versions.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(T value)Iterator<T>createRandomIterator(Random workingRandom)Select in random order, but without shuffling the elements.booleanisEmpty()In aCountableValueRange, this must be consistent withCountableValueRange.getSize().
 
- 
- 
- 
Method Detail- 
isEmptyboolean isEmpty() In aCountableValueRange, this must be consistent withCountableValueRange.getSize().- Returns:
- true if the range is empty
 
 - 
containsboolean contains(T value) - Parameters:
- value- sometimes null
- Returns:
- true if the ValueRange contains that value
 
 - 
createRandomIteratorIterator<T> createRandomIterator(Random workingRandom) Select in random order, but without shuffling the elements. Each element might be selected multiple times. Scales well because it does not require caching.- Parameters:
- workingRandom- never null, the- Randomto use when any random number is needed, so- EnvironmentMode.REPRODUCIBLEworks correctly.- RandomUtilscan be useful too.
- Returns:
- never null
 
 
- 
 
-