org.stringtree.util.iterator
Class AbstractLineIterator

java.lang.Object
  extended by org.stringtree.util.iterator.AbstractIterator
      extended by org.stringtree.util.iterator.AbstractLineIterator
All Implemented Interfaces:
java.util.Iterator, StringIterator
Direct Known Subclasses:
ReaderLineIterator

public abstract class AbstractLineIterator
extends AbstractIterator
implements StringIterator

An Iterator to iterate through the "lines" of a stream or reader.

Author:
Frank Carver

Field Summary
protected  boolean autoclose
           
protected  java.lang.String line
           
protected  boolean updated
           
 
Constructor Summary
AbstractLineIterator(boolean autoclose)
           
 
Method Summary
protected abstract  void close()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 java.lang.String nextString()
           
protected abstract  java.lang.String readLine()
           
protected  void update()
           
 
Methods inherited from class org.stringtree.util.iterator.AbstractIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
remove
 

Field Detail

line

protected java.lang.String line

autoclose

protected boolean autoclose

updated

protected boolean updated
Constructor Detail

AbstractLineIterator

public AbstractLineIterator(boolean autoclose)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Specified by:
hasNext in class AbstractIterator

next

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

nextString

public java.lang.String nextString()
Specified by:
nextString in interface StringIterator

readLine

protected abstract java.lang.String readLine()
                                      throws java.io.IOException
Throws:
java.io.IOException

close

protected abstract void close()

update

protected void update()