Package one.microstream.util.iterables
Class ReadOnlyListIterator<E>
- java.lang.Object
 - 
- one.microstream.util.iterables.ReadOnlyListIterator<E>
 
 
- 
- All Implemented Interfaces:
 Iterator<E>,ListIterator<E>
public class ReadOnlyListIterator<E> extends Object implements ListIterator<E>
Generic (and potentially imperformant!) implementation of aListIterator.
Routes all modifying procedures (add(Object),remove(),set(Object)) to the wrappedListwhich may throw anUnsupportedOperationExceptionif 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.Note that while implementing
ListIterator, this iterator can handle any sequence as it is read only, meaning it can be used for iterating e.g.XGettingEnumcollections as well. 
- 
- 
Constructor Summary
Constructors Constructor Description ReadOnlyListIterator(XGettingSequence<E> list)ReadOnlyListIterator(XGettingSequence<E> list, int index) 
 - 
 
- 
- 
Constructor Detail
- 
ReadOnlyListIterator
public ReadOnlyListIterator(XGettingSequence<E> list) throws IndexBoundsException
- Throws:
 IndexBoundsException
 
- 
ReadOnlyListIterator
public ReadOnlyListIterator(XGettingSequence<E> list, int index) throws IndexBoundsException
- Throws:
 IndexBoundsException
 
 - 
 
- 
Method Detail
- 
add
public void add(E e) throws UnsupportedOperationException
- Specified by:
 addin interfaceListIterator<E>- Throws:
 UnsupportedOperationException
 
- 
hasNext
public boolean hasNext()
 
- 
hasPrevious
public boolean hasPrevious()
- Specified by:
 hasPreviousin interfaceListIterator<E>
 
- 
next
public E next() throws NoSuchElementException
- Specified by:
 nextin interfaceIterator<E>- Specified by:
 nextin interfaceListIterator<E>- Throws:
 NoSuchElementException
 
- 
nextIndex
public int nextIndex()
- Specified by:
 nextIndexin interfaceListIterator<E>
 
- 
previous
public E previous() throws NoSuchElementException
- Specified by:
 previousin interfaceListIterator<E>- Throws:
 NoSuchElementException
 
- 
previousIndex
public int previousIndex()
- Specified by:
 previousIndexin interfaceListIterator<E>
 
- 
remove
public void remove() throws NoSuchElementException, UnsupportedOperationException- Specified by:
 removein interfaceIterator<E>- Specified by:
 removein interfaceListIterator<E>- Throws:
 NoSuchElementExceptionUnsupportedOperationException
 
- 
set
public void set(E e) throws NoSuchElementException, UnsupportedOperationException
- Specified by:
 setin interfaceListIterator<E>- Throws:
 NoSuchElementExceptionUnsupportedOperationException
 
 - 
 
 -