public class BigDecimalValueRange extends AbstractCountableValueRange<BigDecimal>
Constructor and Description |
---|
BigDecimalValueRange(BigDecimal from,
BigDecimal to)
All parameters must have the same
BigDecimal.scale() . |
BigDecimalValueRange(BigDecimal from,
BigDecimal to,
BigDecimal incrementUnit)
All parameters must have the same
BigDecimal.scale() . |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(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.
|
BigDecimal |
get(long index)
Used by uniform random selection in a composite or nullable CountableValueRange.
|
long |
getSize()
Used by uniform random selection in a composite or nullable CountableValueRange.
|
String |
toString() |
isEmpty
public BigDecimalValueRange(BigDecimal from, BigDecimal to)
BigDecimal.scale()
.from
- never null, inclusive minimumto
- never null, exclusive maximum, >= from
public BigDecimalValueRange(BigDecimal from, BigDecimal to, BigDecimal incrementUnit)
BigDecimal.scale()
.from
- never null, inclusive minimumto
- never null, exclusive maximum, >= from
incrementUnit
- never null, > 0
public long getSize()
CountableValueRange
CountableValueRange
, always >= 0
public BigDecimal get(long index)
CountableValueRange
index
- always <
CountableValueRange.getSize()
PlanningVariable.nullable()
is true)public boolean contains(BigDecimal value)
value
- sometimes nullpublic Iterator<BigDecimal> createOriginalIterator()
CountableValueRange
public Iterator<BigDecimal> createRandomIterator(Random workingRandom)
ValueRange
workingRandom
- never null, the Random
to use when any random number is needed,
so EnvironmentMode.REPRODUCIBLE
works correctly. RandomUtils
can be useful too.Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.