long.html

来自「API資料大全」· HTML 代码 · 共 1,168 行 · 第 1/4 页

HTML
1,168
字号
          converted to type <code>float</code> and the result of          the conversion is returned.</DL></DD></DL><HR><A NAME="doubleValue()"><!-- --></A><H3>doubleValue</H3><PRE>public double <B>doubleValue</B>()</PRE><DL><DD>Returns the value of this Long as a double.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Number.html#doubleValue()">doubleValue</A></CODE> in class <CODE><A HREF="../../java/lang/Number.html">Number</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the <code>long</code> value represented by this object that          is converted to type <code>double</code> and the result of          the conversion is returned.</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 a String object representing this Long's value.  The long integer value represented by this Long object is converted  to signed decimal representation and returned as a string, exactly  as if the long value were given as an argument to the  <A HREF="../../java/lang/Long.html#toString(long)"><CODE>toString(long)</CODE></A> method that takes one argument.<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 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>Computes a hashcode for this Long. The result is the exclusive  OR of the two halves of the primitive <code>long</code> value  represented by this <code>Long</code> object. That is, the hashcode  is the value of the expression:  <blockquote><pre> (int)(this.longValue()^(this.longValue()>>>32)) </pre></blockquote><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.</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 against the specified object. The result is <code>true</code> if and only if the argument is not <code>null</code> and is a <code>Long</code> object that contains the same <code>long</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="getLong(java.lang.String)"><!-- --></A><H3>getLong</H3><PRE>public static <A HREF="../../java/lang/Long.html">Long</A> <B>getLong</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm)</PRE><DL><DD>Determines the <code>long</code> 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 a long value  and a <code>Long</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. <p> In other words, this method returns a <tt>Long</tt> object equal to  the value of: <blockquote><pre> getLong(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>Long</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="getLong(java.lang.String, long)"><!-- --></A><H3>getLong</H3><PRE>public static <A HREF="../../java/lang/Long.html">Long</A> <B>getLong</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm,                           long&nbsp;val)</PRE><DL><DD>Determines the <code>long</code> 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 a long value  and a <code>Long</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. A <code>Long</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 a <tt>Long</tt> object equal  to the value of: <blockquote><pre> getLong(nm, new Long(val)) </pre></blockquote> but in practice it may be implemented in a manner such as:  <blockquote><pre> Long result = getLong(nm, null); return (result == null) ? new Long(val) : result; </pre></blockquote> to avoid the unnecessary allocation of a <tt>Long</tt> 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>Long</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="getLong(java.lang.String, java.lang.Long)"><!-- --></A><H3>getLong</H3><PRE>public static <A HREF="../../java/lang/Long.html">Long</A> <B>getLong</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;nm,                           <A HREF="../../java/lang/Long.html">Long</A>&nbsp;val)</PRE><DL><DD>Returns the long 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 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 a long  value, as per the <code>Long.decode</code> method, and a  <code>Long</code> object representing this value is returned. <p><ul> <li>If the property value begins with the two ASCII characters <tt>0x</tt> or the ASCII character <tt>#</tt>, 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/Long.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 character <tt>0</tt> followed by another character, it is parsed as an octal integer exactly as for the method <A HREF="../../java/lang/Long.html#valueOf(java.lang.String, int)"><CODE>valueOf(java.lang.String, int)</CODE></A> with radix 8.  <li>Otherwise the property value is parsed as a decimal integer exactly as for the method  <A HREF="../../java/lang/Long.html#valueOf(java.lang.String, int)"><CODE>valueOf(java.lang.String, int)</CODE></A> with radix 10.  </ul> <p> Note that, in every case, neither <tt>L</tt> nor <tt>l</tt> is  permitted to appear at the end of the property value as a type  indicator, as would be permitted in Java programming language  source code. <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>Long</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/Long.html#decode(java.lang.String)"><CODE>decode(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="compareTo(java.lang.Long)"><!-- --></A><H3>compareTo</H3><PRE>public int <B>compareTo</B>(<A HREF="../../java/lang/Long.html">Long</A>&nbsp;anotherLong)</PRE><DL><DD>Compares two Longs numerically.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>anotherLong</CODE> - the <code>Long</code> to be compared.<DT><B>Returns:</B><DD>the value <code>0</code> if the argument Long is equal to          this Long; a value less than <code>0</code> if this Long          is numerically less than the Long argument; and a          value greater than <code>0</code> if this Long is          numerically greater than the Long 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 Long to another Object.  If the Object is a Long, this function behaves like <code>compareTo(Long)</code>.  Otherwise, it throws a <code>ClassCastException</code> (as Longs are comparable only to other Longs).<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 Long		numerically equal to this Long; a value less than		<code>0</code> if the argument is a Long numerically		greater than this Long; and a value greater than		<code>0</code> if the argument is a Long numerically		less than this Long.<DT><B>Throws:</B><DD><CODE><code>ClassCastException</code></CODE> - if the argument is not a		  <code>Long</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/Long.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/Integer.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/lang/Math.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="Long.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 + =
减小字号Ctrl + -
显示快捷键?