Package one.microstream.util.iterables
Class GenericListIterator<E>
- java.lang.Object
-
- one.microstream.util.iterables.GenericListIterator<E>
-
- All Implemented Interfaces:
Iterator<E>
,ListIterator<E>
public class GenericListIterator<E> extends Object implements ListIterator<E>
Generic (and potentially imperformant!) implementation of aListIterator
.
Routes all modifying procedures (add(Object)
,remove()
,set(Object)
) to the wrappedList
which may throw anUnsupportedOperationException
if it does not support the procedure.If the use of an Iterator is not mandatory (e.g. through an API), it is strongly recommended to instead use Higher Order Programming concepts from "Collection 2.0" types like
XGettingList
,XList
, etc. and their functional procedures etc.
-
-
Constructor Summary
Constructors Constructor Description GenericListIterator(XList<E> list)
GenericListIterator(XList<E> list, int index)
-
-
-
Constructor Detail
-
GenericListIterator
public GenericListIterator(XList<E> list) throws IndexBoundsException
- Throws:
IndexBoundsException
-
GenericListIterator
public GenericListIterator(XList<E> list, int index) throws IndexBoundsException
- Throws:
IndexBoundsException
-
-
Method Detail
-
add
public void add(E e) throws UnsupportedOperationException
- Specified by:
add
in interfaceListIterator<E>
- Throws:
UnsupportedOperationException
-
hasNext
public boolean hasNext()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interfaceListIterator<E>
-
next
public E next() throws NoSuchElementException
- Specified by:
next
in interfaceIterator<E>
- Specified by:
next
in interfaceListIterator<E>
- Throws:
NoSuchElementException
-
nextIndex
public int nextIndex()
- Specified by:
nextIndex
in interfaceListIterator<E>
-
previous
public E previous() throws NoSuchElementException
- Specified by:
previous
in interfaceListIterator<E>
- Throws:
NoSuchElementException
-
previousIndex
public int previousIndex()
- Specified by:
previousIndex
in interfaceListIterator<E>
-
remove
public void remove() throws NoSuchElementException, UnsupportedOperationException
- Specified by:
remove
in interfaceIterator<E>
- Specified by:
remove
in interfaceListIterator<E>
- Throws:
NoSuchElementException
UnsupportedOperationException
-
set
public void set(E e) throws NoSuchElementException, UnsupportedOperationException
- Specified by:
set
in interfaceListIterator<E>
- Throws:
NoSuchElementException
UnsupportedOperationException
-
-