Package org.atlanmod.commons.collect
Class DelegatedListIterator<T,R>
- java.lang.Object
-
- org.atlanmod.commons.collect.DelegatedListIterator<T,R>
-
- Type Parameters:
T- the type of elements returned by the delegated iteratorR- the type of elements returned by this iterator
- All Implemented Interfaces:
Iterator<R>,ListIterator<R>
@ParametersAreNonnullByDefault public class DelegatedListIterator<T,R> extends Object implements ListIterator<R>
AListIteratorthat iterates over another.
-
-
Constructor Summary
Constructors Constructor Description DelegatedListIterator(ListIterator<T> delegate, Converter<T,R> converter)Constructs a newDelegatedIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(R r)booleanhasNext()booleanhasPrevious()Rnext()intnextIndex()Rprevious()intpreviousIndex()voidremove()voidset(R r)-
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
-
DelegatedListIterator
public DelegatedListIterator(ListIterator<T> delegate, Converter<T,R> converter)
Constructs a newDelegatedIterator.- Parameters:
delegate- the delegated list iteratorconverter- the function used to map elements from thedelegate
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
next
public R next()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPreviousin interfaceListIterator<T>
-
previous
public R previous()
- Specified by:
previousin interfaceListIterator<T>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndexin interfaceListIterator<T>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndexin interfaceListIterator<T>
-
remove
public void remove()
-
set
public void set(R r)
- Specified by:
setin interfaceListIterator<T>
-
add
public void add(R r)
- Specified by:
addin interfaceListIterator<T>
-
-