Modifier and Type | Field and Description |
---|---|
static int |
END
Value to set when the range should reach the end of the matrix
|
Constructor and Description |
---|
StepRange(int start,
int stop)
Create a range with start and stop indexes
|
StepRange(int start,
int step,
int stop)
Create a range with a start and stop indexes and a step
|
Modifier and Type | Method and Description |
---|---|
int |
getStart()
Get the start index of the range
|
int |
getStep()
Get the step of the range
|
int |
getStop()
Get the stop index of the range
|
boolean |
hasMore()
Returns true, if more indices are available.
|
int |
index()
Consecutive numbering of current index.
|
void |
init(int lower,
int upper)
Initialize Range to available indices.
|
int |
length()
Returns the total number of indices.
|
void |
next()
Increase counter.
|
void |
setStart(int start)
Set the start index of the range
|
void |
setStep(int step)
Set the step of the range
|
void |
setStop(int stop)
Set the stop index of the range
|
int |
value()
Get current index.
|
public static final int END
public StepRange(int start, int stop)
start
- The start index of the rangestop
- The stop index of the rangepublic StepRange(int start, int step, int stop)
start
- The start index of the rangestep
- The step of the rangestop
- The stop index of the rangepublic int getStart()
public void setStart(int start)
start
- The start index of the range to setpublic int getStep()
public void setStep(int step)
step
- The step of the range to setpublic int getStop()
public void setStop(int stop)
stop
- The stop index of the range to setpublic void init(int lower, int upper)
Range
Range
is used right before the iteration.public int length()
Range
public void next()
Range
public int index()
Range
public int value()
Range