Package org.ametys.plugins.repository
Class UniqueChainedAmetysObjectIterable.UniqueChainedIterator
- java.lang.Object
-
- org.ametys.plugins.repository.UniqueChainedAmetysObjectIterable.UniqueChainedIterator
-
- All Implemented Interfaces:
Iterator<A>
,AmetysObjectIterator<A>
- Enclosing class:
- UniqueChainedAmetysObjectIterable<A extends AmetysObject>
class UniqueChainedAmetysObjectIterable.UniqueChainedIterator extends Object implements AmetysObjectIterator<A>
-
-
Field Summary
Fields Modifier and Type Field Description private int
_currentIterator
private Set<String>
_identifiers
private List<AmetysObjectIterator<A>>
_its
private A
_nextObject
private boolean
_nextObjectSet
private long
_position
-
Constructor Summary
Constructors Constructor Description UniqueChainedIterator(List<AmetysObjectIterator<A>> its)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_fetchNextObject()
Set nextObject to the next object.private boolean
_internalHasNext()
private A
_internalNext()
long
getPosition()
Returns the current position within the iterator.long
getSize()
Returns the number of elements in the iterator.boolean
hasNext()
A
next()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObjectIterator
skip
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Field Detail
-
_identifiers
private Set<String> _identifiers
-
_nextObject
private A extends AmetysObject _nextObject
-
_nextObjectSet
private boolean _nextObjectSet
-
_position
private long _position
-
_currentIterator
private int _currentIterator
-
_its
private List<AmetysObjectIterator<A extends AmetysObject>> _its
-
-
Constructor Detail
-
UniqueChainedIterator
public UniqueChainedIterator(List<AmetysObjectIterator<A>> its)
-
-
Method Detail
-
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
-
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
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<A extends AmetysObject>
-
_fetchNextObject
private boolean _fetchNextObject()
Set nextObject to the next object.- Returns:
- If there are no more objects then return false. Otherwise, return true.
-
_internalHasNext
private boolean _internalHasNext()
-
_internalNext
private A _internalNext()
-
-