Class BigDecimalValueRange
- java.lang.Object
- 
- org.optaplanner.core.impl.domain.valuerange.AbstractCountableValueRange<BigDecimal>
- 
- org.optaplanner.core.impl.domain.valuerange.buildin.bigdecimal.BigDecimalValueRange
 
 
- 
- All Implemented Interfaces:
- CountableValueRange<BigDecimal>,- ValueRange<BigDecimal>
 
 public class BigDecimalValueRange extends AbstractCountableValueRange<BigDecimal> 
- 
- 
Constructor SummaryConstructors Constructor Description BigDecimalValueRange(BigDecimal from, BigDecimal to)All parameters must have the sameBigDecimal.scale().BigDecimalValueRange(BigDecimal from, BigDecimal to, BigDecimal incrementUnit)All parameters must have the sameBigDecimal.scale().
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(BigDecimal value)Iterator<BigDecimal>createOriginalIterator()Select the elements in original (natural) order.Iterator<BigDecimal>createRandomIterator(Random workingRandom)Select in random order, but without shuffling the elements.BigDecimalget(long index)Used by uniform random selection in a composite or nullable CountableValueRange.longgetSize()Used by uniform random selection in a composite or nullable CountableValueRange.StringtoString()- 
Methods inherited from class org.optaplanner.core.impl.domain.valuerange.AbstractCountableValueRangeisEmpty
 
- 
 
- 
- 
- 
Constructor Detail- 
BigDecimalValueRangepublic BigDecimalValueRange(BigDecimal from, BigDecimal to) All parameters must have the sameBigDecimal.scale().- Parameters:
- from- never null, inclusive minimum
- to- never null, exclusive maximum,- >= from
 
 - 
BigDecimalValueRangepublic BigDecimalValueRange(BigDecimal from, BigDecimal to, BigDecimal incrementUnit) All parameters must have the sameBigDecimal.scale().- Parameters:
- from- never null, inclusive minimum
- to- never null, exclusive maximum,- >= from
- incrementUnit- never null,- > 0
 
 
- 
 - 
Method Detail- 
getSizepublic long getSize() Description copied from interface:CountableValueRangeUsed by uniform random selection in a composite or nullable CountableValueRange.- Returns:
- the exact number of elements generated by this CountableValueRange, always>= 0
 
 - 
getpublic BigDecimal get(long index) Description copied from interface:CountableValueRangeUsed by uniform random selection in a composite or nullable CountableValueRange.- Parameters:
- index- always- <- CountableValueRange.getSize()
- Returns:
- sometimes null (if PlanningVariable.nullable()is true)
 
 - 
containspublic boolean contains(BigDecimal value) - Parameters:
- value- sometimes null
- Returns:
- true if the ValueRange contains that value
 
 - 
createOriginalIteratorpublic Iterator<BigDecimal> createOriginalIterator() Description copied from interface:CountableValueRangeSelect the elements in original (natural) order.- Returns:
- never null
 
 - 
createRandomIteratorpublic Iterator<BigDecimal> createRandomIterator(Random workingRandom) Description copied from interface:ValueRangeSelect 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
 
 
- 
 
-