public final class IntRangeIterator extends java.lang.Object implements BoundedIterator<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 other)
Constructs a copy of the iterator.
|
Modifier and Type | Method and Description |
---|---|
IntRangeIterator |
clone()
Creates 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.
|
int |
size()
Returns the size of the collection of the iterated items.
|
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 other)
other
- 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 int size()
BoundedIterator
size
in interface BoundedIterator<java.lang.Integer>
public IntRangeIterator clone()
Iterator