|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ioutil.LineScanner
An object of class LineScanner scans text, breaking it up into tokens.
Field Summary | |
static int |
ECHO
|
static int |
NO_ECHO
|
Constructor Summary | |
LineScanner(java.lang.String str,
int echoPol)
new LineScanner(str, echoPol) returns a new LineScanner for scanning str. |
|
LineScanner(java.lang.String str,
int echoPol,
int skip)
new LineScanner(str, echoPol, skip) returns a new LineScanner for scanning str. |
Method Summary | |
void |
addError(java.lang.String msg)
ls.addError(msg) adds msg to the error list for ls. |
void |
advance()
ls.advance() advances the current position in ls. |
boolean |
atChar()
ls.atChar() returns true if the token at the current position of ls is a character. |
boolean |
atEnd()
ls.atEnd() returns true if the current position of ls is at the end of the line. |
boolean |
atFloat()
ls.atFloat() returns true if the token at the current position of ls is a float. |
boolean |
atInt()
ls.atInt() returns true if the token at the current position of ls is an int. |
boolean |
atString()
ls.atString() returns true if the token at the current position of ls is a string. |
char |
currentChar()
ls.currentChar() returns the string value of the current token of ls. |
float |
currentFloat()
ls.currentFloat() returns the float value of the current token of ls. |
int |
currentInt()
ls.currentInt() returns the int value of the current token of ls. |
java.lang.String |
currentString()
ls.currentString() returns the string value of the current token of ls. |
int |
errorCount()
ls.errorCount() returns the number of error messages in ls. |
int |
getEchoPolicy()
ls.getEchoPolicy(echoPol) returns the echo policy of ls. |
java.lang.String |
getText()
ls.getText(echoPol) returns the text of ls. |
void |
printAllErrors()
ls.printAllErrors() prints all of the error messages in ls to System.out. |
void |
printFirstError()
ls.printFirstError() prints the first error message in ls to System.out, if there is one. |
char |
readChar()
ls.readChar() returns the character value of the current token of ls, then advances the current position. |
void |
readEnd()
ls.readEnd() records an error message in ls if the current position of ls is not at the end of the line. |
float |
readFloat()
ls.readFloat() returns the float value of the current token of ls, then advances the current position. |
int |
readInt()
ls.readInt() returns the int value of the current token of ls, then advances the current position. |
java.lang.String |
readString()
ls.readString() returns the string value of the current token of ls, then advances the current position. |
void |
removeLastError()
ls.removeLastError() removes the last error message from ls. |
void |
setEchoPolicy(int echoPol)
ls.setEchoPolicy(echoPol) changes the echo policy of ls to echoPol. |
void |
setText(java.lang.String str)
ls.setText(str) resets ls in preparation for scanning str. |
void |
setText(java.lang.String str,
int skip)
ls.setText(str, skip) resets ls in preparation for scanning str. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int NO_ECHO
public static final int ECHO
Constructor Detail |
public LineScanner(java.lang.String str, int echoPol, int skip)
public LineScanner(java.lang.String str, int echoPol)
Method Detail |
public void setText(java.lang.String str, int skip)
public void setText(java.lang.String str)
public void setEchoPolicy(int echoPol)
public java.lang.String getText()
public int getEchoPolicy()
public java.lang.String readString()
public char readChar()
public float readFloat()
public int readInt()
public void readEnd()
public boolean atString()
public boolean atChar()
public boolean atFloat()
public boolean atInt()
public boolean atEnd()
public java.lang.String currentString()
public char currentChar()
public float currentFloat()
public int currentInt()
public void advance()
public int errorCount()
public void addError(java.lang.String msg)
public void removeLastError()
public void printFirstError()
public void printAllErrors()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |