net.sf.molae.pipe.trafo
Class TransformListIterator<S,E>

java.lang.Object
  extended by net.sf.molae.pipe.basic.ObjectProxy<ListIterator<S>>
      extended by net.sf.molae.pipe.trafo.TransformListIterator<S,E>
All Implemented Interfaces:
Iterator<E>, ListIterator<E>

public final class TransformListIterator<S,E>
extends ObjectProxy<ListIterator<S>>
implements ListIterator<E>

Transforms each element of a list iterator.

See Also:
TransformedList

Constructor Summary
TransformListIterator(ListIterator<S> base, TwoWayTransformer<S,E> transformer)
          Constructs a TransformListIterator object.
 
Method Summary
 void add(E o)
           
 ListIterator<S> getListIterator()
          Deprecated. leftover from org.apache.commons.collections.iterators.ProxyListIterator
 boolean hasNext()
           
 boolean hasPrevious()
           
 E next()
          Returns the next element in the interation.
 int nextIndex()
           
 E previous()
          Returns the previous element in the list.
 int previousIndex()
           
 void remove()
           
 void set(E o)
           
 
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy
assertNotNull, equals, getBase, hashCode, toString, toVerboseString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransformListIterator

public TransformListIterator(ListIterator<S> base,
                             TwoWayTransformer<S,E> transformer)
Constructs a TransformListIterator object.

Parameters:
base - the underlying ListIterator
transformer - the underlying transformer
Throws:
NullPointerException - if any of the specified objects is null.
Method Detail

getListIterator

public ListIterator<S> getListIterator()
Deprecated. leftover from org.apache.commons.collections.iterators.ProxyListIterator

Getter for property iterator.

Returns:
Value of property iterator.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>
Specified by:
hasNext in interface ListIterator<E>

next

public E next()
Returns the next element in the interation.

Specified by:
next in interface Iterator<E>
Specified by:
next in interface ListIterator<E>
Returns:
the next element in the iteration.
Throws:
NoSuchElementException - iteration has no more elements.

hasPrevious

public boolean hasPrevious()
Specified by:
hasPrevious in interface ListIterator<E>

previous

public E previous()
Returns the previous element in the list.

Specified by:
previous in interface ListIterator<E>
Returns:
the previous element in the list.
Throws:
NoSuchElementException - if the iteration has no previous element.

nextIndex

public int nextIndex()
Specified by:
nextIndex in interface ListIterator<E>

previousIndex

public int previousIndex()
Specified by:
previousIndex in interface ListIterator<E>

remove

public void remove()
Specified by:
remove in interface Iterator<E>
Specified by:
remove in interface ListIterator<E>

set

public void set(E o)
Specified by:
set in interface ListIterator<E>
Throws:
UnsupportedOperationException - depending on the base iterator and transformer
ClassCastException - depending on the base iterator and transformer
IllegalArgumentException - depending on the base iterator and transformer
IllegalStateException - if neither next nor previous have been called, or remove or add have been called after the last call to next or previous.

add

public void add(E o)
Specified by:
add in interface ListIterator<E>
Throws:
UnsupportedOperationException - depending on the base iterator and transformer
ClassCastException - depending on the base iterator and transformer
IllegalArgumentException - depending on the base iterator and transformer