|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface SequenceGenerator
A SequenceGenerator generates a (thread-safe) sequence of (long) integers. The sequence may be implemented in a number of ways: simple up/down counters, state machines, table-driven, non-linear functions... The sequence may implement special behavior at the upper/lower limits of the sequence. The SequenceGenerator interface suggests the basic methods needed to implement such counters. A more general purpose approach might be to use this interface as the basis for a number of abstract adapter classes which could be extended to implement sequences of floating point numbers.
| Method Summary | |
|---|---|
long |
getGreatest()
Get maximum value in sequence |
long |
getLeast()
Get minimum value in sequence |
long |
getNext()
Get next number in sequence |
void |
initialize(long least,
long greatest,
long current)
Set sequence range |
long |
peek(long offset,
boolean wrap)
Look at nth number in sequence (relative to the current number) without actually incrementing. |
void |
reset()
Restart sequence from minimum value |
| Method Detail |
|---|
long getNext()
long getLeast()
long getGreatest()
void initialize(long least,
long greatest,
long current)
throws RangeException
RangeExceptionvoid reset()
long peek(long offset,
boolean wrap)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||