StreamTokenizer Class

The StreamTokenizer class allows a stream to be interpreted as it is being read. The stream can strip out words, numbers, end-of-line markers, and end-of-file markers. The tokenizer works on InputStream classes and Reader classes.

Table 14.4 lists some of the available fields and methods in the StreamTokenizer class. The stream tokenizer reads a token at a time allowing you to perform actions based on the token.

Table 14.4. StreamTokenizer Fields and Methods
Field/Method Description
int ttype Contains the type of token. A token can be one of the following constants:

static int TT_EOF—End of stream

static int TT_EOL—End of line

static int TT_NUMBER—Numeric token

static int TT_WORD—Word token
double nval Value of the numeric ...

Get Borland® JBuilder™ Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.