Module org.arakhne.afc.core.util
Package org.arakhne.afc.sizediterator
Class CollectionSizedIterator<OBJECTT>
- java.lang.Object
-
- org.arakhne.afc.sizediterator.CollectionSizedIterator<OBJECTT>
-
- Type Parameters:
OBJECTT- is the type of the objects to iterator on.
- All Implemented Interfaces:
Iterator<OBJECTT>,SizedIterator<OBJECTT>
public class CollectionSizedIterator<OBJECTT> extends Object implements SizedIterator<OBJECTT>
Iterator on collection.- 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 CollectionSizedIterator(Collection<OBJECTT> collection)Construct an iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()intindex()Replies the position of the last replied element in the iterated collection.OBJECTTnext()voidremove()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
-
-
-
-
Constructor Detail
-
CollectionSizedIterator
public CollectionSizedIterator(Collection<OBJECTT> collection)
Construct an iterator.- Parameters:
collection- the collection to iterate on.
-
-
Method Detail
-
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<OBJECTT>- Returns:
- the index of the last element replied by
next().
-
totalSize
@Pure public int totalSize()
Description copied from interface:SizedIteratorReplies the count of elements in the iterated collection.- Specified by:
totalSizein interfaceSizedIterator<OBJECTT>- 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<OBJECTT>- Returns:
- the count of elements which are not replied by the iterator.
-
-