net.sf.mybatchfwk.history
Class LineIterator

java.lang.Object
  extended by net.sf.mybatchfwk.history.LineIterator
All Implemented Interfaces:
java.util.Iterator

public class LineIterator
extends java.lang.Object
implements java.util.Iterator

An adapter that exposes a buffered reader as an iterator over the returned lines.
The close() method must be called after the iteration to close the reader.

Author:
Jérôme Bertèche (cyberteche@users.sourceforge.net)

Nested Class Summary
static class LineIterator.IOEWrapper
          A wrapper of IOException
 
Constructor Summary
LineIterator(java.io.BufferedReader reader)
           
 
Method Summary
 void close()
          Close the bufferred reader
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineIterator

public LineIterator(java.io.BufferedReader reader)
Parameters:
reader -
Method Detail

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

hasNext

public boolean hasNext()
                throws LineIterator.IOEWrapper
Specified by:
hasNext in interface java.util.Iterator
Throws:
LineIterator.IOEWrapper

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

close

public void close()
Close the bufferred reader



Copyright © 2006 null. All Rights Reserved.