public class MyTokenizer
extends java.lang.Object
MyTokenizer
class takes an input stream and
parses it into "tokens", allowing the tokens to be
read one at a time.
A token is a word made of characters except "blanks".Constructor and Description |
---|
MyTokenizer(java.io.Reader reader)
Create a tokenizer that parses the given character stream.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
currentToken() |
int |
lineno() |
int |
nextToken() |
int |
read()
Read a character
|
java.lang.String |
toString() |
public static final int EOF
public static final int TOKEN
public MyTokenizer(java.io.Reader reader)
reader
- a Reader object providing the input stream.public int read() throws java.io.IOException
java.io.IOException
public int nextToken()
public java.lang.String currentToken()
public int lineno()
public java.lang.String toString()
toString
in class java.lang.Object