public class NumberSequence extends Object implements Sequence
Constructor and Description |
---|
NumberSequence() |
Modifier and Type | Method and Description |
---|---|
long |
getEnd()
Gets the last value in the sequence.
|
long |
getStart()
Gets the beginning of the sequence.
|
long |
getStep()
Gets the step size.
|
boolean |
isCycle()
Determines whether the sequence cycles around (starts from the beginning after reaching the last value).
|
void |
publishNext(String sequenceId,
Properties values)
Asks the sequence to publish its next value(s) to the provided map.
|
void |
reset()
Resets the sequence.
|
NumberSequence |
setCycle(boolean cycle)
Specifies whether the sequence cycles around (starts from the beginning after reaching the last value).
|
NumberSequence |
setEnd(long end)
Sets the last value in the sequence.
|
NumberSequence |
setStart(long start)
Sets the beginning of the sequence.
|
NumberSequence |
setStep(long step)
Sets the step size.
|
public final void publishNext(String sequenceId, Properties values)
Sequence
publishNext
in interface Sequence
sequenceId
- Id of the sequence instance.values
- The properties to provide the next value(s) to.public void reset() throws PerfCakeException
Sequence
reset
in interface Sequence
PerfCakeException
- When it was not possible to initialize the sequence to its original state.public long getStart()
public NumberSequence setStart(long start)
start
- The beginning of the sequence.public long getEnd()
public NumberSequence setEnd(long end)
Long.MIN_VALUE
in case of positive steps (or to Long.MAX_VALUE
in case of negative steps) to disable check of the last value in the interval.end
- The last value in the sequence.public long getStep()
public NumberSequence setStep(long step)
step
- The step size.public boolean isCycle()
public NumberSequence setCycle(boolean cycle)
cycle
- True to allow the sequence to cycle around.Copyright © 2010–2017 PerfCake Community. All rights reserved.