|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metasyntactic.tool.codecounter.JavaSourceTokenStream
JavaSourceTokenStream --- A Stream specialized to Java Source. A helper class for the JavaSource class.
Constructor Summary | |
JavaSourceTokenStream(java.io.InputStream FileInputStream)
Creates a JavaSourceTokenStream object, which supports parsing of Java Source. |
Method Summary | |
boolean |
atEof()
Returns true if you are currently at EOF in the token stream. |
boolean |
atEol()
Returns true if you are currently at EOL in the token stream. |
JavaSourceToken |
currentToken()
Returns the current JavaSourceToken. |
void |
nextToken()
Moves forward one token in the token stream. |
int |
position()
Returns an int representing the current position of the stream. |
void |
previousToken()
Moves back one token in the token stream. |
int |
setPosition(int newPosition)
Sets the position of the stream, unless the passed int is not a legal position within the stream. |
java.lang.String |
tokenString()
Returns the string representation of the current token, or a blank if it's a non-printing character like EOF or EOL. |
java.lang.String |
tokenStringAt(int position)
Returns the string representation of the token at position, or a blank if it's a non-printing character like EOF or EOL. |
java.lang.String |
toString()
A debugging function. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JavaSourceTokenStream(java.io.InputStream FileInputStream) throws java.io.IOException
FileInputStream
- The file containing Java source code to be tokenized.
java.io.IOException
- Thrown if something goes sour with the file.Method Detail |
public void previousToken()
public void nextToken()
public boolean atEof()
public boolean atEol()
public java.lang.String tokenString()
public java.lang.String tokenStringAt(int position)
public int position()
public JavaSourceToken currentToken()
public int setPosition(int newPosition)
newPosition
- The new position.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |