Package org.ametys.plugins.repository
Class NodeIteratorIterable.NodeIteratorIterator
- java.lang.Object
-
- org.ametys.plugins.repository.NodeIteratorIterable.NodeIteratorIterator
-
- All Implemented Interfaces:
Iterator<A>
,AmetysObjectIterator<A>
- Enclosing class:
- NodeIteratorIterable<A extends AmetysObject>
class NodeIteratorIterable.NodeIteratorIterator extends Object implements AmetysObjectIterator<A>
-
-
Field Summary
Fields Modifier and Type Field Description private NodeIterator
_it
private int
_position
-
Constructor Summary
Constructors Constructor Description NodeIteratorIterator(NodeIterator it)
-
Method Summary
All Methods Instance Methods Concrete 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.boolean
hasNext()
A
next()
void
remove()
void
skip(long skipNum)
Skip a number of elements in the iterator.-
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
-
-
-
-
Field Detail
-
_it
private NodeIterator _it
-
_position
private int _position
-
-
Constructor Detail
-
NodeIteratorIterator
public NodeIteratorIterator(NodeIterator it)
-
-
Method Detail
-
getPosition
public long getPosition()
Description copied from interface:AmetysObjectIterator
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.- Specified by:
getPosition
in interfaceAmetysObjectIterator<A extends AmetysObject>
- Returns:
- a long
-
getSize
public long getSize()
Description copied from interface:AmetysObjectIterator
Returns the number of elements in the iterator. If this information is unavailable, returns -1.- Specified by:
getSize
in interfaceAmetysObjectIterator<A extends AmetysObject>
- Returns:
- a long
-
skip
public void skip(long skipNum)
Description copied from interface:AmetysObjectIterator
Skip a number of elements in the iterator.
The default implementation simply callsskipNum
timesIterator.next()
.- Specified by:
skip
in interfaceAmetysObjectIterator<A extends AmetysObject>
- Parameters:
skipNum
- the non-negative number of elements to skip
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<A extends AmetysObject>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<A extends AmetysObject>
-
-