public class IntValueRange extends AbstractCountableValueRange<Integer>
Constructor and Description |
---|
IntValueRange(int from,
int to) |
IntValueRange(int from,
int to,
int incrementUnit) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Integer value) |
Iterator<Integer> |
createOriginalIterator()
Select the elements in original (natural) order.
|
Iterator<Integer> |
createRandomIterator(Random workingRandom)
Select in random order, but without shuffling the elements.
|
Integer |
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 IntValueRange(int from, int to)
from
- inclusive minimumto
- exclusive maximum, >= from
public IntValueRange(int from, int to, int incrementUnit)
from
- inclusive minimumto
- exclusive maximum, >= from
incrementUnit
- > 0
public long getSize()
CountableValueRange
CountableValueRange
, always >= 0
public boolean contains(Integer value)
value
- sometimes nullpublic Integer get(long index)
CountableValueRange
index
- always <
CountableValueRange.getSize()
PlanningVariable.nullable()
is true)public Iterator<Integer> createOriginalIterator()
CountableValueRange
public Iterator<Integer> 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.