public class NullableCountableValueRange<T> extends AbstractCountableValueRange<T>
Constructor and Description |
---|
NullableCountableValueRange(CountableValueRange<T> childValueRange) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T value) |
Iterator<T> |
createOriginalIterator()
Select the elements in original (natural) order.
|
Iterator<T> |
createRandomIterator(Random workingRandom)
Select in random order, but without shuffling the elements.
|
T |
get(long index)
Used by uniform random selection in a composite or nullable CountableValueRange.
|
ValueRange<T> |
getChildValueRange() |
long |
getSize()
Used by uniform random selection in a composite or nullable CountableValueRange.
|
String |
toString() |
isEmpty
public NullableCountableValueRange(CountableValueRange<T> childValueRange)
public ValueRange<T> getChildValueRange()
public long getSize()
CountableValueRange
CountableValueRange
, always >= 0
public T get(long index)
CountableValueRange
index
- always <
CountableValueRange.getSize()
PlanningVariable.nullable()
is true)public boolean contains(T value)
value
- sometimes nullpublic Iterator<T> createOriginalIterator()
CountableValueRange
public Iterator<T> 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.