- java.lang.Object
-
- org.arakhne.afc.sizediterator.SingleIterator<OBJECT>
-
- Type Parameters:
OBJECT
- is the type of the objects to iterator on.
- All Implemented Interfaces:
Iterator<OBJECT>
,SizedIterator<OBJECT>
public class SingleIterator<OBJECT> extends Object implements SizedIterator<OBJECT>
Single iterator.- 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 SingleIterator(OBJECT obj)
Construct an iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
int
index()
Replies the position of the last replied element in the iterated collection.OBJECT
next()
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
SingleIterator
public SingleIterator(OBJECT obj)
Construct an iterator.- Parameters:
obj
- the object to iterate on.
-
-
Method Detail
-
index
@Pure public int index()
Description copied from interface:SizedIterator
Replies the position of the last replied element in the iterated collection.- Specified by:
index
in interfaceSizedIterator<OBJECT>
- Returns:
- the index of the last element replied by
next()
.
-
totalSize
@Pure public int totalSize()
Description copied from interface:SizedIterator
Replies the count of elements in the iterated collection.- Specified by:
totalSize
in interfaceSizedIterator<OBJECT>
- Returns:
- the count of elements in the iterated collection.
-
rest
@Pure public int rest()
Description copied from interface:SizedIterator
Replies the count of elements which are not replied by the iterator.- Specified by:
rest
in interfaceSizedIterator<OBJECT>
- Returns:
- the count of elements which are not replied by the iterator.
-
-