streamtokenizer.html

来自「API資料大全」· HTML 代码 · 共 895 行 · 第 1/3 页

HTML
895 行
字号
 constants in this tokenizer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/StreamTokenizer.html#resetSyntax()">resetSyntax</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resets this tokenizer's syntax table so that all characters are "ordinary." See the <code>ordinaryChar</code> method for more information on a character being ordinary.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/StreamTokenizer.html#slashSlashComments(boolean)">slashSlashComments</A></B>(boolean&nbsp;flag)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines whether or not the tokenizer recognizes C++-style comments.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/StreamTokenizer.html#slashStarComments(boolean)">slashStarComments</A></B>(boolean&nbsp;flag)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines whether or not the tokenizer recognizes C-style comments.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/StreamTokenizer.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the string representation of the current stream token.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/StreamTokenizer.html#whitespaceChars(int, int)">whitespaceChars</A></B>(int&nbsp;low,                int&nbsp;hi)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that all characters <i>c</i> in the range <code>low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high</code> are white space characters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/StreamTokenizer.html#wordChars(int, int)">wordChars</A></B>(int&nbsp;low,          int&nbsp;hi)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies that all characters <i>c</i> in the range <code>low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high</code> are word constituents.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="ttype"><!-- --></A><H3>ttype</H3><PRE>public int <B>ttype</B></PRE><DL><DD>After a call to the <code>nextToken</code> method, this field contains the type of the token just read. For a single character token, its value is the single character, converted to an integer. For a quoted string token (see , its value is the quote character. Otherwise, its value is one of the following: <ul> <li><code>TT_WORD</code> indicates that the token is a word. <li><code>TT_NUMBER</code> indicates that the token is a number. <li><code>TT_EOL</code> indicates that the end of line has been read.     The field can only have this value if the     <code>eolIsSignificant</code> method has been called with the     argument <code>true</code>. <li><code>TT_EOF</code> indicates that the end of the input stream     has been reached. </ul> <p> The initial value of this field is -4.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#eolIsSignificant(boolean)"><CODE>eolIsSignificant(boolean)</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#nextToken()"><CODE>nextToken()</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#quoteChar(int)"><CODE>quoteChar(int)</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_EOF"><CODE>TT_EOF</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_EOL"><CODE>TT_EOL</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_NUMBER"><CODE>TT_NUMBER</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_WORD"><CODE>TT_WORD</CODE></A></DL></DD></DL><HR><A NAME="TT_EOF"><!-- --></A><H3>TT_EOF</H3><PRE>public static final int <B>TT_EOF</B></PRE><DL><DD>A constant indicating that the end of the stream has been read.</DL><HR><A NAME="TT_EOL"><!-- --></A><H3>TT_EOL</H3><PRE>public static final int <B>TT_EOL</B></PRE><DL><DD>A constant indicating that the end of the line has been read.</DL><HR><A NAME="TT_NUMBER"><!-- --></A><H3>TT_NUMBER</H3><PRE>public static final int <B>TT_NUMBER</B></PRE><DL><DD>A constant indicating that a number token has been read.</DL><HR><A NAME="TT_WORD"><!-- --></A><H3>TT_WORD</H3><PRE>public static final int <B>TT_WORD</B></PRE><DL><DD>A constant indicating that a word token has been read.</DL><HR><A NAME="sval"><!-- --></A><H3>sval</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>sval</B></PRE><DL><DD>If the current token is a word token, this field contains a string giving the characters of the word token. When the current token is a quoted string token, this field contains the body of the string. <p> The current token is a word when the value of the <code>ttype</code> field is <code>TT_WORD</code>. The current token is a quoted string token when the value of the <code>ttype</code> field is a quote character. <p> The initial value of this field is null.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/io/StreamTokenizer.html#quoteChar(int)"><CODE>quoteChar(int)</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#TT_WORD"><CODE>TT_WORD</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#ttype"><CODE>ttype</CODE></A></DL></DD></DL><HR><A NAME="nval"><!-- --></A><H3>nval</H3><PRE>public double <B>nval</B></PRE><DL><DD>If the current token is a number, this field contains the value of that number. The current token is a number when the value of the <code>ttype</code> field is <code>TT_NUMBER</code>. <p> The initial value of this field is 0.0.<DD><DL><DT><B>See Also: </B><DD><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><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="StreamTokenizer(java.io.InputStream)"><!-- --></A><H3>StreamTokenizer</H3><PRE>public <B>StreamTokenizer</B>(<A HREF="../../java/io/InputStream.html">InputStream</A>&nbsp;is)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>As of JDK version 1.1, the preferred way to tokenize an input stream is to convert it into a character stream, for example: <blockquote><pre>   Reader r = new BufferedReader(new InputStreamReader(is));   StreamTokenizer st = new StreamTokenizer(r); </pre></blockquote></I><P><DD>Creates a stream tokenizer that parses the specified input stream. The stream tokenizer is initialized to the following default state: <ul> <li>All byte values <code>'A'</code> through <code>'Z'</code>,     <code>'a'</code> through <code>'z'</code>, and     <code>'&#92;u00A0'</code> through <code>'&#92;u00FF'</code> are     considered to be alphabetic. <li>All byte values <code>'&#92;u0000'</code> through     <code>'&#92;u0020'</code> are considered to be white space. <li><code>'/'</code> is a comment character. <li>Single quote <code>'&#92;''</code> and double quote <code>'"'</code>     are string quote characters. <li>Numbers are parsed. <li>Ends of lines are treated as white space, not as separate tokens. <li>C-style and C++-style comments are not recognized. </ul><DD><DL><DT><B>Parameters:</B><DD><CODE>is</CODE> - an input stream.<DT><B>See Also: </B><DD><A HREF="../../java/io/BufferedReader.html"><CODE>BufferedReader</CODE></A>, <A HREF="../../java/io/InputStreamReader.html"><CODE>InputStreamReader</CODE></A>, <A HREF="../../java/io/StreamTokenizer.html#StreamTokenizer(java.io.Reader)"><CODE>StreamTokenizer(java.io.Reader)</CODE></A></DL></DD></DL><HR><A NAME="StreamTokenizer(java.io.Reader)"><!-- --></A><H3>StreamTokenizer</H3><PRE>public <B>StreamTokenizer</B>(<A HREF="../../java/io/Reader.html">Reader</A>&nbsp;r)</PRE><DL><DD>Create a tokenizer that parses the given character stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - a Reader object providing the input stream.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="resetSyntax()"><!-- --></A><H3>resetSyntax</H3><PRE>public void <B>resetSyntax</B>()</PRE><DL><DD>Resets this tokenizer's syntax table so that all characters are "ordinary." See the <code>ordinaryChar</code> method for more information on a character being ordinary.<DD><DL><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="wordChars(int, int)"><!-- --></A><H3>wordChars</H3><PRE>public void <B>wordChars</B>(int&nbsp;low,                      int&nbsp;hi)</PRE><DL><DD>Specifies that all characters <i>c</i> in the range <code>low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high</code> are word constituents. A word token consists of a word constituent followed by zero or more word constituents or number constituents.<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.</DL></DD></DL><HR><A NAME="whitespaceChars(int, int)"><!-- --></A><H3>whitespaceChars</H3><PRE>public void <B>whitespaceChars</B>(int&nbsp;low,                            int&nbsp;hi)</PRE><DL><DD>Specifies that all characters <i>c</i> in the range <code>low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high</code> are white space characters. White space characters serve only to separate tokens in the input stream.<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.</DL></DD></DL><HR><A NAME="ordinaryChars(int, int)"><!-- --></A><H3>ordinaryChars</H3><PRE>public void <B>ordinaryChars</B>(int&nbsp;low,                          int&nbsp;hi)</PRE>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?