streamtokenizer.html
来自「API資料大全」· HTML 代码 · 共 895 行 · 第 1/3 页
HTML
895 行
<DL><DD>Specifies that all characters <i>c</i> in the range <code>low <= <i>c</i> <= high</code> are "ordinary" in this tokenizer. See the <code>ordinaryChar</code> method for more information on a character being ordinary.<DD><DL><DT><B>Parameters:</B><DD><CODE>low</CODE> - the low end of the range.<DD><CODE>hi</CODE> - the high end of the range.<DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#ordinaryChar(int)"><CODE>ordinaryChar(int)</CODE></A></DL></DD></DL><HR><A NAME="ordinaryChar(int)"><!-- --></A><H3>ordinaryChar</H3><PRE>public void <B>ordinaryChar</B>(int ch)</PRE><DL><DD>Specifies that the character argument is "ordinary" in this tokenizer. It removes any special significance the character has as a comment character, word component, string delimiter, white space, or number character. When such a character is encountered by the parser, the parser treates it as a single-character token and sets <code>ttype</code> field to the character value.<DD><DL><DT><B>Parameters:</B><DD><CODE>ch</CODE> - the character.<DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A></DL></DD></DL><HR><A NAME="commentChar(int)"><!-- --></A><H3>commentChar</H3><PRE>public void <B>commentChar</B>(int ch)</PRE><DL><DD>Specified that the character argument starts a single-line comment. All characters from the comment character to the end of the line are ignored by this stream tokenizer.<DD><DL><DT><B>Parameters:</B><DD><CODE>ch</CODE> - the character.</DL></DD></DL><HR><A NAME="quoteChar(int)"><!-- --></A><H3>quoteChar</H3><PRE>public void <B>quoteChar</B>(int ch)</PRE><DL><DD>Specifies that matching pairs of this character delimit string constants in this tokenizer. <p> When the <code>nextToken</code> method encounters a string constant, the <code>ttype</code> field is set to the string delimiter and the <code>sval</code> field is set to the body of the string. <p> If a string quote character is encountered, then a string is recognized, consisting of all characters after (but not including) the string quote character, up to (but not including) the next occurrence of that same string quote character, or a line terminator, or end of file. The usual escape sequences such as <code>"\n"</code> and <code>"\t"</code> are recognized and converted to single characters as the string is parsed.<DD><DL><DT><B>Parameters:</B><DD><CODE>ch</CODE> - the character.<DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#nextToken()"><CODE>nextToken()</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#sval"><CODE>sval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A></DL></DD></DL><HR><A NAME="parseNumbers()"><!-- --></A><H3>parseNumbers</H3><PRE>public void <B>parseNumbers</B>()</PRE><DL><DD>Specifies that numbers should be parsed by this tokenizer. The syntax table of this tokenizer is modified so that each of the twelve characters: <blockquote><pre> 0 1 2 3 4 5 6 7 8 9 . - </pre></blockquote> <p> has the "numeric" attribute. <p> When the parser encounters a word token that has the format of a double precision floating-point number, it treats the token as a number rather than a word, by setting the the <code>ttype</code> field to the value <code>TT_NUMBER</code> and putting the numeric value of the token into the <code>nval</code> field.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#nval"><CODE>nval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_NUMBER"><CODE>TT_NUMBER</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A></DL></DD></DL><HR><A NAME="eolIsSignificant(boolean)"><!-- --></A><H3>eolIsSignificant</H3><PRE>public void <B>eolIsSignificant</B>(boolean flag)</PRE><DL><DD>Determines whether or not ends of line are treated as tokens. If the flag argument is true, this tokenizer treats end of lines as tokens; the <code>nextToken</code> method returns <code>TT_EOL</code> and also sets the <code>ttype</code> field to this value when an end of line is read. <p> A line is a sequence of characters ending with either a carriage-return character (<code>'\r'</code>) or a newline character (<code>'\n'</code>). In addition, a carriage-return character followed immediately by a newline character is treated as a single end-of-line token. <p> If the <code>flag</code> is false, end-of-line characters are treated as white space and serve only to separate tokens.<DD><DL><DT><B>Parameters:</B><DD><CODE>flag</CODE> - <code>true</code> indicates that end-of-line characters are separate tokens; <code>false</code> indicates that end-of-line characters are white space.<DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#nextToken()"><CODE>nextToken()</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_EOL"><CODE>TT_EOL</CODE></A></DL></DD></DL><HR><A NAME="slashStarComments(boolean)"><!-- --></A><H3>slashStarComments</H3><PRE>public void <B>slashStarComments</B>(boolean flag)</PRE><DL><DD>Determines whether or not the tokenizer recognizes C-style comments. If the flag argument is <code>true</code>, this stream tokenizer recognizes C-style comments. All text between successive occurrences of <code>/*</code> and <code>*/</code> are discarded. <p> If the flag argument is <code>false</code>, then C-style comments are not treated specially.<DD><DL><DT><B>Parameters:</B><DD><CODE>flag</CODE> - <code>true</code> indicates to recognize and ignore C-style comments.</DL></DD></DL><HR><A NAME="slashSlashComments(boolean)"><!-- --></A><H3>slashSlashComments</H3><PRE>public void <B>slashSlashComments</B>(boolean flag)</PRE><DL><DD>Determines whether or not the tokenizer recognizes C++-style comments. If the flag argument is <code>true</code>, this stream tokenizer recognizes C++-style comments. Any occurrence of two consecutive slash characters (<code>'/'</code>) is treated as the beginning of a comment that extends to the end of the line. <p> If the flag argument is <code>false</code>, then C++-style comments are not treated specially.<DD><DL><DT><B>Parameters:</B><DD><CODE>flag</CODE> - <code>true</code> indicates to recognize and ignore C++-style comments.</DL></DD></DL><HR><A NAME="lowerCaseMode(boolean)"><!-- --></A><H3>lowerCaseMode</H3><PRE>public void <B>lowerCaseMode</B>(boolean fl)</PRE><DL><DD>Determines whether or not word token are automatically lowercased. If the flag argument is <code>true</code>, then the value in the <code>sval</code> field is lowercased whenever a word token is returned (the <code>ttype</code> field has the value <code>TT_WORD</code> by the <code>nextToken</code> method of this tokenizer. <p> If the flag argument is <code>false</code>, then the <code>sval</code> field is not modified.<DD><DL><DT><B>Parameters:</B><DD><CODE>fl</CODE> - <code>true</code> indicates that all word tokens should be lowercased.<DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#nextToken()"><CODE>nextToken()</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_WORD"><CODE>TT_WORD</CODE></A></DL></DD></DL><HR><A NAME="nextToken()"><!-- --></A><H3>nextToken</H3><PRE>public int <B>nextToken</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE><DL><DD>Parses the next token from the input stream of this tokenizer. The type of the next token is returned in the <code>ttype</code> field. Additional information about the token may be in the <code>nval</code> field or the <code>sval</code> field of this tokenizer. <p> Typical clients of this class first set up the syntax tables and then sit in a loop calling nextToken to parse successive tokens until TT_EOF is returned.<DD><DL><DT><B>Returns:</B><DD>the value of the <code>ttype</code> field.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.<DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#nval"><CODE>nval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#sval"><CODE>sval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A></DL></DD></DL><HR><A NAME="pushBack()"><!-- --></A><H3>pushBack</H3><PRE>public void <B>pushBack</B>()</PRE><DL><DD>Causes the next call to the <code>nextToken</code> method of this tokenizer to return the current value in the <code>ttype</code> field, and not to modify the value in the <code>nval</code> or <code>sval</code> field.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#nextToken()"><CODE>nextToken()</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#nval"><CODE>nval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#sval"><CODE>sval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A></DL></DD></DL><HR><A NAME="lineno()"><!-- --></A><H3>lineno</H3><PRE>public int <B>lineno</B>()</PRE><DL><DD>Return the current line number.<DD><DL><DT><B>Returns:</B><DD>the current line number of this stream tokenizer.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns the string representation of the current stream token.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of the token specified by the <code>ttype</code>, <code>nval</code>, and <code>sval</code> fields.<DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#nval"><CODE>nval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#sval"><CODE>sval</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StreamTokenizer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/io/SerializablePermission.html"><B>PREV CLASS</B></A> <A HREF="../../java/io/StringBufferInputStream.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="StreamTokenizer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?