public class RandomAccessIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
This iterator will only work efficiently on lists that implement the
RandomAccess
interface.
(IMHO this is the best solution for a broken requirement)
Constructor and Description |
---|
RandomAccessIterator(java.util.List<E> list) |
public RandomAccessIterator(java.util.List<E> list)
public static <T> java.util.List<T> list(java.util.List<T> src)
RandomAccessIterator
from
iterator
. listIterator
is not supported. All other methods
are forwarded directly to the underlying list.T
- src
- public boolean hasNext()
hasNext
in interface java.util.Iterator<E>
public void remove()
remove
in interface java.util.Iterator<E>