public final class CircularSequence extends Object
| Constructor and Description |
|---|
CircularSequence(int size)
A sequence of integers from 0 to
size
that cycle back to zero when reaching the end;
the starting point is the last point in the sequence,
so that a call to next() delivers the first value, 0. |
| Modifier and Type | Method and Description |
|---|---|
int |
move(int inc)
Will wrap around.
|
int |
next() |
int |
previous() |
int |
setPosition(int k)
Will wrap around if
k<0 or k>size. |
public CircularSequence(int size)
size
that cycle back to zero when reaching the end;
the starting point is the last point in the sequence,
so that a call to next() delivers the first value, 0.size - The length of the range to cycle over.Copyright © 2015–2021 Fiji. All rights reserved.