|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Range
The Range interface represents basically a set of indices. Before using a range you have to call init() with the actually available lower and upper bounds, such that you can also have an "AllRange" which contains all possible indices.
Further operations include:
Typical uses look like this:
for (r.init(lower, upper); r.hasMore(); r.next()) {
System.out.printf("Value number %d is %d%n", index(), value());
}
| Method Summary | |
|---|---|
boolean |
hasMore()
More indices available? |
int |
index()
Consecutive numbering of current index. |
void |
init(int lower,
int upper)
Initialize Range to available indices |
int |
length()
Total number of indices. |
void |
next()
Increase counter. |
int |
value()
Get current index. |
| Method Detail |
|---|
void init(int lower,
int upper)
int length()
void next()
int index()
int value()
boolean hasMore()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||