Class SequenceIterator<T>
- java.lang.Object
-
- ru.ispras.testbase.knowledge.iterator.SequenceIterator<T>
-
- Type Parameters:
T
- the item type.
- All Implemented Interfaces:
Iterator<T>
- Direct Known Subclasses:
FpDivHardToRoundIterator
,FpMulHardToRoundIterator
,FpSqrtHardToRoundIterator
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.
-
-
Constructor Summary
Constructors Modifier Constructor Description SequenceIterator()
Constructs a sequence iterator.protected
SequenceIterator(SequenceIterator<T> other)
Constructs a copy of the sequence iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
SequenceIterator
public SequenceIterator()
Constructs a sequence iterator.
-
SequenceIterator
protected SequenceIterator(SequenceIterator<T> other)
Constructs a copy of the sequence iterator.- Parameters:
other
- the iterator to be copied.
-
-
Method Detail
-
registerIterator
public void registerIterator(Iterator<T> iterator)
Registers the iterator.- Parameters:
iterator
- the iterator to be registered.
-
clear
public void clear()
Removes all registered iterators.
-
size
public int size()
Returns the number of the registered iterators.- Returns:
- the number of the registered iterators.
-
iterator
public Iterator<T> iterator(int index)
Returns the i-th iterator of the list.- Parameters:
index
- the index of iterator in the list.- Returns:
- the i-th iterator of the list.
-
init
public void init()
Description copied from interface:Iterator
Initializes the iterator.
-
hasValue
public boolean hasValue()
Description copied from interface:Iterator
Checks if the iterator is not exhausted (a value is available).
-
value
public T value()
Description copied from interface:Iterator
Returns the current value of the iterator.
-
next
public void next()
Description copied from interface:Iterator
Makes an iteration.
-
stop
public void stop()
Description copied from interface:Iterator
Stops the iterator.
-
-