org.pandora.util
Class TextStream

java.lang.Object
  extended by org.pandora.util.TextStream

public class TextStream
extends java.lang.Object

Provides a useful text stream class.


Field Summary
static java.lang.String TOKENS
           
static java.lang.String WHITESPACE
           
 
Constructor Summary
TextStream(java.lang.String text)
           
 
Method Summary
 boolean atEnd()
           
 boolean atStart()
           
 void backup()
           
 void backup(int count)
           
 void backupTo(char token)
           
 void backupTo(char token, boolean including)
           
 void backupToAll(java.lang.String tokens)
           
 void backupToAll(java.lang.String tokens, boolean including)
           
 char current()
           
 java.lang.String currentLine()
           
 int currentLineColumn()
           
 int currentLineNumber()
           
 int getPosition()
           
 java.lang.String getText()
           
 char last()
           
 char next()
           
 java.lang.String next(int count)
           
 java.lang.String nextLine()
           
 java.lang.String nextWhitespace()
           
 java.lang.String nextWord()
           
 char peek()
           
 java.lang.String peek(int count)
           
 java.lang.String peekWord()
           
 char previous()
           
 java.lang.String previous(int count)
           
 void setPosition(int index)
           
 void skip()
           
 void skip(int count)
           
 void skipLine()
           
 void skipTo(char token)
           
 boolean skipTo(char token, boolean including)
           
 void skipToAll(java.lang.String tokens)
           
 boolean skipToAll(java.lang.String tokens, boolean including)
           
 void skipWhitespace()
           
 java.lang.String toString()
           
 java.lang.String upTo(char token)
           
 java.lang.String upTo(char token, boolean including)
           
 java.lang.String upTo(char token, boolean including, boolean resetIfNotFound)
           
 java.lang.String upToAll(java.lang.String tokens)
           
 java.lang.String upToAll(java.lang.String tokens, boolean including)
           
 java.lang.String upToAll(java.lang.String tokens, boolean including, boolean resetIfNotFound)
           
 java.lang.String upToAny(java.lang.String tokens)
           
 java.lang.String upToAny(java.lang.String tokens, boolean including)
           
 java.lang.String upToEnd()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WHITESPACE

public static final java.lang.String WHITESPACE
See Also:
Constant Field Values

TOKENS

public static final java.lang.String TOKENS
See Also:
Constant Field Values
Constructor Detail

TextStream

public TextStream(java.lang.String text)
Method Detail

last

public char last()

current

public char current()

peek

public char peek()

next

public char next()

previous

public char previous()

skip

public void skip()

skip

public void skip(int count)

backup

public void backup(int count)

backup

public void backup()

peek

public java.lang.String peek(int count)

previous

public java.lang.String previous(int count)

next

public java.lang.String next(int count)

atEnd

public boolean atEnd()

atStart

public boolean atStart()

upTo

public java.lang.String upTo(char token)

skipTo

public void skipTo(char token)

upToEnd

public java.lang.String upToEnd()

upTo

public java.lang.String upTo(char token,
                             boolean including)

upTo

public java.lang.String upTo(char token,
                             boolean including,
                             boolean resetIfNotFound)

skipTo

public boolean skipTo(char token,
                      boolean including)

backupTo

public void backupTo(char token)

backupTo

public void backupTo(char token,
                     boolean including)

upToAny

public java.lang.String upToAny(java.lang.String tokens)

upToAny

public java.lang.String upToAny(java.lang.String tokens,
                                boolean including)

upToAll

public java.lang.String upToAll(java.lang.String tokens)

upToAll

public java.lang.String upToAll(java.lang.String tokens,
                                boolean including)

upToAll

public java.lang.String upToAll(java.lang.String tokens,
                                boolean including,
                                boolean resetIfNotFound)

skipToAll

public void skipToAll(java.lang.String tokens)

skipToAll

public boolean skipToAll(java.lang.String tokens,
                         boolean including)

backupToAll

public void backupToAll(java.lang.String tokens)

backupToAll

public void backupToAll(java.lang.String tokens,
                        boolean including)

peekWord

public java.lang.String peekWord()

nextWord

public java.lang.String nextWord()

nextWhitespace

public java.lang.String nextWhitespace()

skipWhitespace

public void skipWhitespace()

nextLine

public java.lang.String nextLine()

currentLine

public java.lang.String currentLine()

currentLineNumber

public int currentLineNumber()

currentLineColumn

public int currentLineColumn()

skipLine

public void skipLine()

getPosition

public int getPosition()

setPosition

public void setPosition(int index)

getText

public java.lang.String getText()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object