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