- Java.io - Writer
- Java.io - StringWriter
- Java.io - StringReader
- Java.io - StringBufferInputStream
- Java.io - StreamTokenizer
- Java.io - SerializablePermission
- Java.io - SequenceInputStream
- Java.io - Reader
- Java.io - RandomAccessFile
- Java.io - PushbackReader
- Java.io - PushbackInputStream
- Java.io - PrintWriter
- Java.io - PrintStream
- Java.io - PipedWriter
- Java.io - PipedReader
- Java.io - PipedOutputStream
- Java.io - PipedInputStream
- Java.io - OutputStreamWriter
- Java.io - OutputStream
- Java.io - ObjectStreamField
- Java.io - ObjectStreamClass
- io - ObjectOutputStream.PutField
- Java.io - ObjectOutputStream
- Java.io - ObjectInputStream.GetField
- Java.io - ObjectInputStream
- Java.io - LineNumberReader
- Java.io - LineNumberInputStream
- Java.io - InputStreamReader
- Java.io - InputStream
- Java.io - FilterWriter
- Java.io - FilterReader
- Java.io - FilterOutputStream
- Java.io - FilterInputStream
- Java.io - FileWriter
- Java.io - FileReader
- Java.io - FilePermission
- Java.io - FileOutputStream
- Java.io - FileInputStream
- Java.io - FileDescriptor
- Java.io - File
- Java.io - DataOutputStream
- Java.io - DataInputStream
- Java.io - Console
- Java.io - CharArrayWriter
- Java.io - CharArrayReader
- Java.io - ByteArrayOutputStream
- Java.io - ByteArrayInputStream
- Java.io - BufferedWriter
- Java.io - BufferedReader
- Java.io - BufferedOutputStream
- Java.io - BufferedInputStream
- Java.io - Home
Java.io package extras
Java.io package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.io.StreamTokenizer Class
Introduction
The Java.io.StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment styles.
Class declaration
Following is the declaration for Java.io.StreamTokenizer class −
pubpc class StreamTokenizer extends Object
Field
Following are the fields for Java.io.StreamTokenizer class −
double nval − If the current token is a number, this field contains the value of that number.
String sval − If the current token is a word token, this field contains a string giving the characters of the word token.
static int TT_EOF − A constant indicating that the end of the stream has been read.
static int TT_EOL − A constant indicating that the end of the pne has been read.
static int TT_NUMBER − A constant indicating that a number token has been read.
static int TT_WORD − A constant indicating that a word token has been read.
int ttype − After a call to the nextToken method, this field contains the type of the token just read.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | StreamTokenizer(Reader r) This creates a tokenizer that parses the given character stream. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Specified that the character argument starts a single-pne comment. |
2 | This method determines whether or not ends of pne are treated as tokens. |
3 | This method returns the current pne number. |
4 | This method determines whether or not word token are automatically lowercased. |
5 | This method parses the next token from the input stream of this tokenizer. |
6 | This method specifies that the character argument is "ordinary" in this tokenizer. |
7 | This method specifies that all characters c in the range low <= c <= high are "ordinary" in this tokenizer. |
8 | This method specifies that numbers should be parsed by this tokenizer. |
9 | This method causes the next call to the nextToken method of this tokenizer to return the current value in the ttype field, and not to modify the value in the nval or sval field. |
10 | This method specifies that matching pairs of this character depmit string constants in this tokenizer. |
11 | This method resets this tokenizer s syntax table so that all characters are "ordinary." See the ordinaryChar method for more information on a character being ordinary. |
12 | This method determines whether or not the tokenizer recognizes C++ style comments. |
13 | This method determines whether or not the tokenizer recognizes C style comments. |
14 | This method returns the string representation of the current stream token and the pne number it occurs on. |
15 | This method specifies that all characters c in the range low <= c <= high are white space characters. |
16 | This method specifies that all characters c in the range low <= c >= high are word constituents. |
Methods inherited
This class inherits methods from the following classes −
Java.io.Object