T
- the item type.public class SequenceIterator<T> extends java.lang.Object implements Iterator<T>
SequenceIterator
implements a sequence iterator, a composite iterator that concatenates
sequences produced by simpler iterators.Modifier | Constructor and Description |
---|---|
|
SequenceIterator()
Constructs a sequence iterator.
|
protected |
SequenceIterator(SequenceIterator<T> other)
Constructs a copy of the sequence iterator.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all registered iterators.
|
SequenceIterator<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.
|
Iterator<T> |
iterator(int index)
Returns the i-th iterator of the list.
|
void |
next()
Makes an iteration.
|
void |
registerIterator(Iterator<T> iterator)
Registers the iterator.
|
int |
size()
Returns the number of the registered iterators.
|
void |
stop()
Stops the iterator.
|
T |
value()
Returns the current value of the iterator.
|
public SequenceIterator()
protected SequenceIterator(SequenceIterator<T> other)
other
- the iterator to be copied.public void registerIterator(Iterator<T> iterator)
iterator
- the iterator to be registered.public void clear()
public int size()
public Iterator<T> iterator(int index)
index
- the index of iterator in the list.public void init()
Iterator
public boolean hasValue()
Iterator
public T value()
Iterator
public void next()
Iterator
public void stop()
Iterator