Package org.ametys.plugins.repository
Interface AmetysObjectIterator<A extends AmetysObject>
-
- Type Parameters:
A
- the actual type ofAmetysObject
s.
- All Superinterfaces:
Iterator<A>
public interface AmetysObjectIterator<A extends AmetysObject> extends Iterator<A>
Iterates overAmetysObject
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description long
getPosition()
Returns the current position within the iterator.long
getSize()
Returns the number of elements in the iterator.default void
skip(long skipNum)
Skip a number of elements in the iterator.-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
-
-
-
Method Detail
-
getPosition
long getPosition()
Returns the current position within the iterator. The number returned is the 0-based index of the next element in the iterator, i.e. the one that will be returned on the subsequentnext
call.
Note that this method does not check if there is a next element, i.e. an empty iterator will always return 0.- Returns:
- a long
-
getSize
long getSize()
Returns the number of elements in the iterator. If this information is unavailable, returns -1.- Returns:
- a long
-
skip
default void skip(long skipNum)
Skip a number of elements in the iterator.
The default implementation simply callsskipNum
timesIterator.next()
.- Parameters:
skipNum
- the non-negative number of elements to skip- Throws:
NoSuchElementException
- if skipped past the last element in the iterator.
-
-