net.sf.molae.pipe.correct
Class CorrectIterator
java.lang.Object
|
+--org.apache.commons.collections.iterators.ProxyIterator
|
+--net.sf.molae.pipe.correct.CorrectIterator
- All Implemented Interfaces:
- Iterator
- public class CorrectIterator
- extends org.apache.commons.collections.iterators.ProxyIterator
Wrapper class to receive the correct exceptions from iterators.
| Methods inherited from class org.apache.commons.collections.iterators.ProxyIterator |
getIterator, hasNext, next, setIterator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CorrectIterator
public CorrectIterator(Iterator base)
- Constructs a new exception safe iterator wrapper.
- Parameters:
base - the underlying iterator- Throws:
NullPointerException - if the specified object is
null.
remove
public void remove()
- Calls the corresponding method of the base iterator
and maps
NoSuchElementException to
IllegalStateException.
- Overrides:
remove in class org.apache.commons.collections.iterators.ProxyIterator
- Throws:
UnsupportedOperationException - depending on the base iteratorIllegalStateException - if the base iterator has thrown a
IllegalStateException or
NoSuchElementException