T
- the item type.public final class SingleValueIterator<T> extends java.lang.Object implements BoundedIterator<T>
SingleValueIterator
implements a single-value iterator.Constructor and Description |
---|
SingleValueIterator(SingleValueIterator<T> other)
Constructs a copy of the iterator.
|
SingleValueIterator(T value)
Constructs a single-value iterator.
|
Modifier and Type | Method and Description |
---|---|
Iterator<T> |
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.
|
int |
size()
Returns the size of the collection of the iterated items.
|
void |
stop()
Stops the iterator.
|
T |
value()
Returns the current value of the iterator.
|
public SingleValueIterator(T value)
value
- the value to be returned by the iterator.public SingleValueIterator(SingleValueIterator<T> other)
other
- the iterator to be copied.public void init()
Iterator
public boolean hasValue()
Iterator
public T value()
Iterator
public void next()
Iterator
public void stop()
Iterator
public int size()
BoundedIterator
size
in interface BoundedIterator<T>