|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.morph.transform.support.ResetableIteratorWrapper
public class ResetableIteratorWrapper
Reads the contents of an Iterator and saves them so that the Iterator can be iterated over multiple times.
Constructor Summary | |
---|---|
ResetableIteratorWrapper()
|
|
ResetableIteratorWrapper(java.util.Iterator iterator)
|
Method Summary | |
---|---|
java.util.Iterator |
getIterator()
Returns a fresh copy of the wrapped iterator that is ready for another iteration. |
boolean |
hasNext()
|
java.lang.Object |
next()
|
void |
remove()
|
void |
reset()
|
void |
setIterator(java.util.Iterator iterator)
Sets the delegate iterator for this wrapper. |
int |
size()
Get the size of the underlying Iterator. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResetableIteratorWrapper()
public ResetableIteratorWrapper(java.util.Iterator iterator)
Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
public void reset()
public java.util.Iterator getIterator()
null
if the delegate iterator was never setpublic void setIterator(java.util.Iterator iterator)
iterator
- the Iterator to set
java.lang.IllegalStateException
- if the iterator has already been set
java.lang.IllegalArgumentException
- if the iterator is nullpublic int size()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |