- java.lang.Object
-
- org.arakhne.afc.sizediterator.MultiSizedIterator<M>
-
- Type Parameters:
M- is the type of element.
- All Implemented Interfaces:
Iterator<M>,SizedIterator<M>
public class MultiSizedIterator<M> extends Object implements SizedIterator<M>
A sized iterator that is based on the used of a collection of sized iterators.- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- util
-
-
Constructor Summary
Constructors Constructor Description MultiSizedIterator()Construct an iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIterator(SizedIterator<? extends M> iterator)Add an iterator in the list of iterators.booleanhasNext()intindex()Replies the position of the last replied element in the iterated collection.Mnext()intrest()Replies the count of elements which are not replied by the iterator.inttotalSize()Replies the count of elements in the iterated collection.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
addIterator
public void addIterator(SizedIterator<? extends M> iterator)
Add an iterator in the list of iterators.- Parameters:
iterator- the iterator.
-
totalSize
@Pure public int totalSize()
Description copied from interface:SizedIteratorReplies the count of elements in the iterated collection.- Specified by:
totalSizein interfaceSizedIterator<M>- Returns:
- the count of elements in the iterated collection.
-
rest
@Pure public int rest()
Description copied from interface:SizedIteratorReplies the count of elements which are not replied by the iterator.- Specified by:
restin interfaceSizedIterator<M>- Returns:
- the count of elements which are not replied by the iterator.
-
index
@Pure public int index()
Description copied from interface:SizedIteratorReplies the position of the last replied element in the iterated collection.- Specified by:
indexin interfaceSizedIterator<M>- Returns:
- the index of the last element replied by
next().
-
-