xbn.util
Class ForLineRetrieval

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.util.ForLineRetrieval
Direct Known Subclasses:
FLRFile, FLRString

public abstract class ForLineRetrieval
extends XBNObject

Represents multiple-line source text, from which lines are retrieved individually, and in order.

Source code:  ForLineRetrieval.java.  Example code  See the example code for FLRFile.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
protected ForLineRetrieval(String s_lineSep)
           
 
Method Summary
 int getLineNumberNext()
          What is the number of the line about to be read?
 int getLineNumberPrev()
          How many lines have been read thus far?.
 String getLineSeparator()
           
 int getLineSepLength()
           
abstract  StringBuffer getNextLine()
          Get the next line of text from the source.
abstract  boolean hasMoreLines()
          Are there more lines to be retrieved with getNextLine?
protected  void incLineNumber()
          Increment the line number.
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForLineRetrieval

protected ForLineRetrieval(String s_lineSep)
Method Detail

getNextLine

public abstract StringBuffer getNextLine()

Get the next line of text from the source.


getLineNumberNext

public final int getLineNumberNext()

What is the number of the line about to be read?


getLineNumberPrev

public final int getLineNumberPrev()

How many lines have been read thus far?. What is the number of the line that was just read in?

Returns:
(getLineNumberNext() - 1)

incLineNumber

protected final void incLineNumber()

Increment the line number. Sometime during getNextLine, this must be called. Of course, don't call it after the entire text has been processed.


hasMoreLines

public abstract boolean hasMoreLines()

Are there more lines to be retrieved with getNextLine?

Returns:
true If there are more lines to be processed.
false If all lines have been processed.

getLineSeparator

public final String getLineSeparator()

getLineSepLength

public final int getLineSepLength()



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo