SourceJammer 1.3.0 November 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan

org.sourcejammer.server.source
Class TextLineAdderIterator

java.lang.Object
  |
  +--org.sourcejammer.server.source.TextLineIteratorOutput
        |
        +--org.sourcejammer.server.source.TextLineAdderIterator
All Implemented Interfaces:
java.io.Serializable, TextLineAdder, TextLineIterator

public class TextLineAdderIterator
extends TextLineIteratorOutput
implements TextLineAdder, java.io.Serializable

Builds a text file like TextLineAdder and allows iteration through lines like TextLineIterator.

See Also:
Serialized Form

Constructor Summary
TextLineAdderIterator()
           
 
Method Summary
 java.lang.String getNextLine()
          Returns the next line, if there are more lines to return.
 boolean hasMoreLines()
          Returns true if this text line iterator has more lines.
 void skipLines(int numLines)
          Skips the requested number of lines.
 char[] toCharArray()
           
 char[] toCharArray(java.lang.String eol)
           
 java.lang.String toString()
          Returns contents of this TextLineAdderIterator (the entire text file) as a String, the default end of line chars (from AppConfig) as the end of line String.
 java.lang.String toString(java.lang.String eol)
          Returns contents of this TextLineAdderIterator (the entire text file) as a String, using the passed in eol as the end of line String.
 java.lang.StringBuffer toStringBuffer(java.lang.String eol)
          Returns contents of this TextLineAdderIterator (the entire text file) as a StringBuffer, using the passed in eol as the end of line String.
 void writeLine(char[] line)
           
 void writeLine(java.lang.String sLine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextLineAdderIterator

public TextLineAdderIterator()
Method Detail

writeLine

public void writeLine(char[] line)
Specified by:
writeLine in interface TextLineAdder

writeLine

public void writeLine(java.lang.String sLine)
Specified by:
writeLine in interface TextLineAdder

hasMoreLines

public boolean hasMoreLines()
Description copied from interface: TextLineIterator
Returns true if this text line iterator has more lines.
Overrides:
hasMoreLines in class TextLineIteratorOutput

getNextLine

public java.lang.String getNextLine()
                             throws EndOfSourceException
Returns the next line, if there are more lines to return.
Overrides:
getNextLine in class TextLineIteratorOutput
Throws:
EndOfSourceException - -- if there are no more lines to return.

skipLines

public void skipLines(int numLines)
               throws EndOfSourceException
Skips the requested number of lines.
Overrides:
skipLines in class TextLineIteratorOutput
Throws:
EndOfSourceException - -- if skipping requested number of lines would point index past end of source file.

toStringBuffer

public java.lang.StringBuffer toStringBuffer(java.lang.String eol)
Returns contents of this TextLineAdderIterator (the entire text file) as a StringBuffer, using the passed in eol as the end of line String.
Overrides:
toStringBuffer in class TextLineIteratorOutput

toString

public java.lang.String toString(java.lang.String eol)
Returns contents of this TextLineAdderIterator (the entire text file) as a String, using the passed in eol as the end of line String.
Overrides:
toString in class TextLineIteratorOutput

toString

public java.lang.String toString()
Returns contents of this TextLineAdderIterator (the entire text file) as a String, the default end of line chars (from AppConfig) as the end of line String.
Overrides:
toString in class TextLineIteratorOutput

toCharArray

public char[] toCharArray(java.lang.String eol)
Overrides:
toCharArray in class TextLineIteratorOutput

toCharArray

public char[] toCharArray()
Overrides:
toCharArray in class TextLineIteratorOutput

SourceJammer 1.3.0 November 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan