public final class IntRangeIterator extends java.lang.Object implements Iterator<java.lang.Integer>
IntRangeIterator
implements an integer number iterator over given range.Modifier | Constructor and Description |
---|---|
|
IntRangeIterator(int max)
Constructs an integer number range iterator with the lower bound equal to zero and the
increment value equal to one.
|
|
IntRangeIterator(int min,
int max)
Constructs an integer number range iterator with the increment value equal to one.
|
|
IntRangeIterator(int min,
int max,
int inc)
Constructs an integer number range iterator.
|
protected |
IntRangeIterator(IntRangeIterator r)
Constructs a copy of the iterator.
|
Modifier and Type | Method and Description |
---|---|
IntRangeIterator |
clone()
Returns a copy of the iterator.
|
boolean |
hasValue()
Checks if the iterator is not exhausted (a value is available).
|
void |
init()
Initializes the iterator.
|
void |
next()
Makes an iteration.
|
void |
setValue(int value)
Sets the current value.
|
void |
stop()
Stops the iterator.
|
java.lang.Integer |
value()
Returns the current value of the iterator.
|
public IntRangeIterator(int min, int max, int inc)
min
- the lower bound.max
- the upper bound.inc
- the increment value (step).public IntRangeIterator(int min, int max)
min
- the lower bound.max
- the upper bound.public IntRangeIterator(int max)
max
- the upper bound.protected IntRangeIterator(IntRangeIterator r)
r
- the iterator to be copied.public void setValue(int value)
value
- the value to set.public void init()
Iterator
public boolean hasValue()
Iterator
public java.lang.Integer value()
Iterator
public void next()
Iterator
public void stop()
Iterator
public IntRangeIterator clone()
Iterator