net.sf.molae.pipe.correct
Class CorrectIterator<E>

java.lang.Object
  extended by net.sf.molae.pipe.correct.CorrectIterator<E>
All Implemented Interfaces:
Iterator<E>

public class CorrectIterator<E>
extends Object
implements Iterator<E>

Wrapper class to receive the correct exceptions from iterators.


Constructor Summary
CorrectIterator(Iterator<? extends E> base)
          Constructs a new exception safe iterator wrapper.
 
Method Summary
 Iterator<? extends E> getIterator()
          Deprecated. leftover from org.apache.commons.collections.iterators.ProxyIterator
 boolean hasNext()
           
 E next()
           
 void remove()
          Calls the corresponding method of the base iterator and maps NoSuchElementException to IllegalStateException.
 void setIterator(Iterator<? extends E> iterator)
          Deprecated. leftover from org.apache.commons.collections.iterators.ProxyIterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CorrectIterator

public CorrectIterator(Iterator<? extends E> base)
Constructs a new exception safe iterator wrapper.

Parameters:
base - the underlying iterator
Throws:
NullPointerException - if the specified object is null.
Method Detail

getIterator

public Iterator<? extends E> getIterator()
Deprecated. leftover from org.apache.commons.collections.iterators.ProxyIterator

Getter for property iterator.

Returns:
Value of property iterator.

setIterator

public void setIterator(Iterator<? extends E> iterator)
Deprecated. leftover from org.apache.commons.collections.iterators.ProxyIterator

Setter for property iterator.

Parameters:
iterator - New value of property iterator.

hasNext

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

next

public E next()
Specified by:
next in interface Iterator<E>

remove

public void remove()
Calls the corresponding method of the base iterator and maps NoSuchElementException to IllegalStateException.

Specified by:
remove in interface Iterator<E>
Throws:
UnsupportedOperationException - depending on the base iterator
IllegalStateException - if the base iterator has thrown a IllegalStateException or NoSuchElementException