-
- Type Parameters:
M
- is the type of element.
- All Superinterfaces:
Iterator<M>
- All Known Implementing Classes:
ArraySizedIterator
,CollectionSizedIterator
,EmptyIterator
,ModifiableCollectionSizedIterator
,MultiSizedIterator
,SingleIterator
,UnmodifiableCollectionSizedIterator
,UnmodifiableMapKeySizedIterator
,UnmodifiableMapValueSizedIterator
,UnmodifiableSizedIterator
public interface SizedIterator<M> extends Iterator<M>
A sized iterator is an Iterator that is able to reply the size of the iterated collection and the number of elements that may be encountered in the next iterations.- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- util
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
index()
Replies the position of the last replied element in the iterated collection.default int
rest()
Replies the count of elements which are not replied by the iterator.int
totalSize()
Replies the count of elements in the iterated collection.-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
-
-
-
Method Detail
-
totalSize
@Pure int totalSize()
Replies the count of elements in the iterated collection.- Returns:
- the count of elements in the iterated collection.
-
rest
@Pure default int rest()
Replies the count of elements which are not replied by the iterator.- Returns:
- the count of elements which are not replied by the iterator.
-
index
@Pure int index()
Replies the position of the last replied element in the iterated collection.- Returns:
- the index of the last element replied by
next()
.
-
-