|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.io.StreamTokenizerAdapter
This class adapts between a java.io.StreamTokenizer
and a edu.stanford.nlp.io.StreamTokenizer
.
Constructor Summary | |
StreamTokenizerAdapter(StreamTokenizer st)
Create a new StreamTokenizer . |
Method Summary | |
boolean |
isEol(String str)
Say whether the String is the end-of-line token for
this tokenizer. |
String |
next()
Returns the next token from the input Reader. |
void |
pushBack()
Pushback the last read token from the tokenizer for re-reading. |
void |
setEolString(String eolString)
Set the String returned when the inner tokenizer
returns an end-of-line token. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StreamTokenizerAdapter(StreamTokenizer st)
StreamTokenizer
. In general, it is
recommended that the passed in StreamTokenizer
should
have had resetSyntax()
done to it, so that numbers are
returned as entered as of type String
, though this
code will cope as best it can.
st
- The internal java.io.StreamTokenizer
Method Detail |
public String next() throws IOException
null
.
next
in interface StreamTokenizer
IOException
- If there is some I/O errorpublic void pushBack()
next()
will return the same
token as the last call to next()
. This allows just
a single level of lookahead in token reading.
pushBack
in interface StreamTokenizer
public void setEolString(String eolString)
String
returned when the inner tokenizer
returns an end-of-line token. This will only happen if the
inner tokenizer has been set to eolIsSignificant(true)
.
eolString
- The String used to represent eol. It is not allowed
to be null
(which would confuse line ends and file end)public boolean isEol(String str)
String
is the end-of-line token for
this tokenizer.
str
- The String being tested
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |