⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 integer.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<DL><DD>Returns a String object representing this Integer's value. The  value is converted to signed decimal representation and returned  as a string, exactly as if the integer value were given as an  argument to the <A HREF="../../java/lang/Integer.html#toString(int)"><CODE>toString(int)</CODE></A> method.<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 value of this object in          base&nbsp;10.</DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Returns a hashcode for this Integer.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a hash code value for this object, equal to the           primitive <tt>int</tt> value represented by this           <tt>Integer</tt> object.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Compares this object to the specified object. The result is <code>true</code> if and only if the argument is not <code>null</code> and is an <code>Integer</code> object that contains the same <code>int</code> value as this object.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the object to compare with.<DT><B>Returns:</B><DD><code>true</code> if the objects are the same;          <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="getInteger(java.lang.String)"><!-- --></A><H3>getInteger</H3><PRE>public static <A HREF="../../java/lang/Integer.html">Integer</A> <B>getInteger</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm)</PRE><DL><DD>Determines the integer value of the system property with the specified name. <p> The first argument is treated as the name of a system property.  System properties are accessible through the  <A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A> method. The  string value of this property is then interpreted as an integer  value and an <code>Integer</code> object representing this value is  returned. Details of possible numeric formats can be found with  the definition of <code>getProperty</code>.  <p> If there is no property with the specified name, if the specified name is empty or null, or if the property does not have the correct numeric format, then <code>null</code> is returned. In other words, this method returns an <code>Integer</code> object equal to the value of: <blockquote><pre> getInteger(nm, null) </pre></blockquote><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>nm</CODE> - property name.<DT><B>Returns:</B><DD>the <code>Integer</code> value of the property.<DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A>, <A HREF="../../java/lang/System.html#getProperty(java.lang.String, java.lang.String)"><CODE>System.getProperty(java.lang.String, java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getInteger(java.lang.String, int)"><!-- --></A><H3>getInteger</H3><PRE>public static <A HREF="../../java/lang/Integer.html">Integer</A> <B>getInteger</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm,                                 int&nbsp;val)</PRE><DL><DD>Determines the integer value of the system property with the specified name. <p> The first argument is treated as the name of a system property.  System properties are accessible through <code>getProperty</code>,  a method defined by the <code>System</code> class. The  string value of this property is then interpreted as an integer  value and an <code>Integer</code> object representing this value is  returned. Details of possible numeric formats can be found with  the definition of <code>getProperty</code>.  <p> The second argument is the default value. An <code>Integer</code> object that represents the value of the second argument is returned if there is no property of the specified name, if the property does not have the correct numeric format, or if the specified name is empty or null. <p> In other words, this method returns an <code>Integer</code> object  equal to the value of: <blockquote><pre> getInteger(nm, new Integer(val)) </pre></blockquote> but in practice it may be implemented in a manner such as:  <blockquote><pre> Integer result = getInteger(nm, null); return (result == null) ? new Integer(val) : result; </pre></blockquote> to avoid the unnecessary allocation of an <code>Integer</code>  object when the default value is not needed.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>nm</CODE> - property name.<DD><CODE>val</CODE> - default value.<DT><B>Returns:</B><DD>the <code>Integer</code> value of the property.<DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A>, <A HREF="../../java/lang/System.html#getProperty(java.lang.String, java.lang.String)"><CODE>System.getProperty(java.lang.String, java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getInteger(java.lang.String, java.lang.Integer)"><!-- --></A><H3>getInteger</H3><PRE>public static <A HREF="../../java/lang/Integer.html">Integer</A> <B>getInteger</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm,                                 <A HREF="../../java/lang/Integer.html">Integer</A>&nbsp;val)</PRE><DL><DD>Returns the integer value of the system property with the specified name.  The first argument is treated as the name of a system property. System properties are accessible through <code>getProperty</code>,  a method defined by the <code>System</code> class. The string value of this property is then interpreted as an integer value, as per the <code>Integer.decode</code> method, and an <code>Integer</code> object representing this value is returned. <p> <ul><li>If the property value begins with the two ASCII characters          <code>0x</code> or the ASCII character <code>#</code>, not       followed by a minus sign, then the rest of it is parsed as a       hexadecimal integer exactly as for the method       <A HREF="../../java/lang/Integer.html#valueOf(java.lang.String, int)"><CODE>valueOf(java.lang.String, int)</CODE></A> with radix 16.  <li>If the property value begins with the ASCII character      <code>0</code> followed by another character, it is parsed as an      octal integer exactly as for the method      <A HREF="../../java/lang/Integer.html#valueOf(java.lang.String, int)"><CODE>with radix 8.  <li>Otherwise, the property value is parsed as a decimal integer  exactly as for the method {@link #valueOf(java.lang.String, int)</CODE></A>  with radix 10.  </ul><p> The second argument is the default value. The default value is returned if there is no property of the specified name, if the property does not have the correct numeric format, or if the specified name is empty or null.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>nm</CODE> - property name.<DD><CODE>val</CODE> - default value.<DT><B>Returns:</B><DD>the <code>Integer</code> value of the property.<DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A>, <A HREF="../../java/lang/System.html#getProperty(java.lang.String, java.lang.String)"><CODE>System.getProperty(java.lang.String, java.lang.String)</CODE></A>, <A HREF="../../java/lang/Integer.html#decode(java.lang.String)"><CODE>decode(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="decode(java.lang.String)"><!-- --></A><H3>decode</H3><PRE>public static <A HREF="../../java/lang/Integer.html">Integer</A> <B>decode</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm)                      throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE><DL><DD>Decodes a <code>String</code> into an <code>Integer</code>.  Accepts decimal, hexadecimal, and octal numbers, in the following formats: <pre>     [-]        decimal constant     [-] 0x     hex constant     [-] #      hex constant     [-] 0      octal constant </pre> The constant following an (optional) negative sign and/or "radix specifier" is parsed as by the <code>Integer.parseInt</code> method with the specified radix (10, 8 or 16).  This constant must be positive or a NumberFormatException will result.  The result is made negative if first character of the specified <code>String</code> is the negative sign.  No whitespace characters are permitted in the <code>String</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>nm</CODE> - the <code>String</code> to decode.<DT><B>Returns:</B><DD>the <code>Integer</code> represented by the specified string.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - if the <code>String</code> does not            contain a parsable integer.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Integer.html#parseInt(java.lang.String, int)"><CODE>parseInt(String, int)</CODE></A></DL></DD></DL><HR><A NAME="compareTo(java.lang.Integer)"><!-- --></A><H3>compareTo</H3><PRE>public int <B>compareTo</B>(<A HREF="../../java/lang/Integer.html">Integer</A>&nbsp;anotherInteger)</PRE><DL><DD>Compares two Integers numerically.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>anotherInteger</CODE> - the <code>Integer</code> to be compared.<DT><B>Returns:</B><DD>the value <code>0</code> if the argument Integer is equal to          this Integer; a value less than <code>0</code> if this Integer          is numerically less than the Integer argument; and a          value greater than <code>0</code> if this Integer is          numerically greater than the Integer argument		(signed comparison).<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="compareTo(java.lang.Object)"><!-- --></A><H3>compareTo</H3><PRE>public int <B>compareTo</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Compares this Integer to another Object.  If the Object is a Integer, this function behaves like <code>compareTo(Integer)</code>.  Otherwise, it throws a <code>ClassCastException</code> (as Integers are comparable only to other Integers).<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../java/lang/Comparable.html#compareTo(java.lang.Object)">compareTo</A></CODE> in interface <CODE><A HREF="../../java/lang/Comparable.html">Comparable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>o</CODE> - the <code>Object</code> to be compared.<DT><B>Returns:</B><DD>the value <code>0</code> if the argument is a Integer		numerically equal to this Integer; a value less than		<code>0</code> if the argument is a Integer numerically		greater than this Integer; and a value greater than		<code>0</code> if the argument is a Integer numerically		less than this Integer.<DT><B>Throws:</B><DD><CODE><code>ClassCastException</code></CODE> - if the argument is not an		  <code>Integer</code>.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/Comparable.html"><CODE>Comparable</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Integer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/lang/InheritableThreadLocal.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/lang/Long.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>  &nbsp;&nbsp;<A HREF="Integer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -