...
Code Block | ||||
---|---|---|---|---|
| ||||
public class Counter {
private int start, end, pos;
public Counter(int start, int end) {
this.start = start;
this.end = end;
}
public int getCounter() {
return this.pos;
}
public boolean count() {
if (pos >= end) {
return false;
}
this.pos = this.pos + 1;
return true;
}
} |
...