public class TemporalValueRange<Temporal_ extends Temporal & Comparable<? super Temporal_>> extends AbstractCountableValueRange<Temporal_>
Constructor and Description |
---|
TemporalValueRange(Temporal_ from,
Temporal_ to,
long incrementUnitAmount,
TemporalUnit incrementUnitType) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Temporal_ value) |
Iterator<Temporal_> |
createOriginalIterator()
Select the elements in original (natural) order.
|
Iterator<Temporal_> |
createRandomIterator(Random workingRandom)
Select in random order, but without shuffling the elements.
|
Temporal_ |
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 TemporalValueRange(Temporal_ from, Temporal_ to, long incrementUnitAmount, TemporalUnit incrementUnitType)
from
- never null, inclusive minimumto
- never null, exclusive maximum, >= from
incrementUnitAmount
- > 0
incrementUnitType
- never null, must be supported
by from
and to
public long getSize()
CountableValueRange
CountableValueRange
, always >= 0
public Temporal_ get(long index)
CountableValueRange
index
- always <
CountableValueRange.getSize()
PlanningVariable.nullable()
is true)public boolean contains(Temporal_ value)
value
- sometimes nullpublic Iterator<Temporal_> createOriginalIterator()
CountableValueRange
public Iterator<Temporal_> 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.