public final class LongRangeIterator extends java.lang.Object implements BoundedIterator<java.lang.Long>
LongRangeIterator
implements an iterator over given range.Modifier | Constructor and Description |
---|---|
|
LongRangeIterator(long max)
Constructs an long number range iterator with the lower bound equal to zero and the increment
value equal to one.
|
|
LongRangeIterator(long min,
long max)
Constructs an long number range iterator with the increment value equal to one.
|
|
LongRangeIterator(long min,
long max,
long inc)
Constructs a range iterator.
|
protected |
LongRangeIterator(LongRangeIterator other)
Constructs a copy of the iterator.
|
Modifier and Type | Method and Description |
---|---|
LongRangeIterator |
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(long value)
Sets the current value.
|
int |
size()
Returns the size of the collection of the iterated items.
|
void |
stop()
Stops the iterator.
|
java.lang.Long |
value()
Returns the current value of the iterator.
|
public LongRangeIterator(long min, long max, long inc)
min
- the lower bound.max
- the upper bound.inc
- the increment value (step).public LongRangeIterator(long min, long max)
min
- the lower bound.max
- the upper bound.public LongRangeIterator(long max)
max
- the upper bound.protected LongRangeIterator(LongRangeIterator other)
other
- the iterator to be copied.public void setValue(long value)
value
- the value to set.public void init()
Iterator
public boolean hasValue()
Iterator
public java.lang.Long value()
Iterator
public void next()
Iterator
public void stop()
Iterator
public int size()
BoundedIterator
size
in interface BoundedIterator<java.lang.Long>
public LongRangeIterator clone()
Iterator