📄 long.html
字号:
<code>Long</code> object.</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="toString(long, int)"><!-- --></A><H3>
toString</H3>
<PRE>
public static <A HREF="../../java/lang/String.html">String</A> <B>toString</B>(long i, int radix)</PRE>
<DL>
<DD>Creates a string representation of the first argument in the radix specified by the second argument. <p> If the radix is smaller than <code>Character.MIN_RADIX</code> or larger than <code>Character.MAX_RADIX</code>, then the radix <code>10</code> is used instead. <p> If the first argument is negative, the first element of the result is the ASCII minus sign <code>'-'</code> (<code>'\u002d'</code>. If the first argument is not negative, no sign character appears in the result. <p> The remaining characters of the result represent the magnitude of the first argument. If the magnitude is zero, it is represented by a single zero character <code>'0'</code> (<code>'\u0030'</code>); otherwise, the first character of the representation of the magnitude will not be the zero character. The following ASCII characters are used as digits: <blockquote><pre> 0123456789abcdefghijklmnopqrstuvwxyz </pre></blockquote> These are <tt>'\u0030'</tt> through <tt>'\u0039'</tt> and <tt>'\u0061'</tt> through <tt>'\u007a'</tt>. If the radix is <var>N</var>, then the first <var>N</var> of these characters are used as radix-<var>N</var> digits in the order shown. Thus, the digits for hexadecimal (radix 16) are <blockquote><pre> <tt>0123456789abcdef</tt>. </pre></blockquote><DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - a long.<DD><CODE>radix</CODE> - the radix.<DT><B>Returns:</B><DD>a string representation of the argument in the specified radix.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Character.html#MAX_RADIX"><CODE>Character.MAX_RADIX</CODE></A>,
<A HREF="../../java/lang/Character.html#MIN_RADIX"><CODE>Character.MIN_RADIX</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="toString(long)"><!-- --></A><H3>
toString</H3>
<PRE>
public static <A HREF="../../java/lang/String.html">String</A> <B>toString</B>(long i)</PRE>
<DL>
<DD>Returns a new String object representing the specified integer. The argument is converted to signed decimal representation and returned as a string, exactly as if the argument and the radix 10 were given as arguments to the <A HREF="../../java/lang/Long.html#toString(long, int)"><CODE>toString(long, int)</CODE></A> method that takes two arguments.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - a <code>long</code> to be converted.<DT><B>Returns:</B><DD>a string representation of the argument in base 10.</DL>
</DD>
</DL>
<HR>
<A NAME="parseLong(java.lang.String, int)"><!-- --></A><H3>
parseLong</H3>
<PRE>
public static long <B>parseLong</B>(<A HREF="../../java/lang/String.html">String</A> s, int radix) throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE>
<DL>
<DD>Parses the string argument as a signed <code>long</code> in the radix specified by the second argument. The characters in the string must all be digits of the specified radix (as determined by whether <code>Character.digit</code> returns a nonnegative value), except that the first character may be an ASCII minus sign <code>'-'</code> (<tt>'\u002d'</tt> to indicate a negative value. The resulting <code>long</code> value is returned. <p> Note that neither <tt>L</tt> nor <tt>l</tt> is permitted to appear at the end of the string as a type indicator, as would be permitted in Java programming language source code - except that either <tt>L</tt> or <tt>l</tt> may appear as a digit for a radix greater than 22. <p> An exception of type <tt>NumberFormatException</tt> is thrown if any of the following situations occurs: <ul> <li>The first argument is <tt>null</tt> or is a string of length zero. <li>The <tt>radix</tt> is either smaller than <A HREF="../../java/lang/Character.html#MIN_RADIX"><CODE>Character.MIN_RADIX</CODE></A> or larger than <A HREF="../../java/lang/Character.html#MAX_RADIX"><CODE>Character.MAX_RADIX</CODE></A>. <li>The first character of the string is not a digit of the specified <tt>radix</tt> and is not a minus sign <tt>'-'</tt> (<tt>'\u002d'</tt>). <li>The first character of the string is a minus sign and the string is of length 1. <li>Any character of the string after the first is not a digit of the specified <tt>radix</tt>. <li>The integer value represented by the string cannot be represented as a value of type <tt>long</tt>. </ul><p> Examples: <blockquote><pre> parseLong("0", 10) returns 0L parseLong("473", 10) returns 473L parseLong("-0", 10) returns 0L parseLong("-FF", 16) returns -255L parseLong("1100110", 2) returns 102L parseLong("99", 8) throws a NumberFormatException parseLong("Hazelnut", 10) throws a NumberFormatException parseLong("Hazelnut", 36) returns 1356099454469L </pre></blockquote><DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - the <code>String</code> containing the <code>long</code>.<DD><CODE>radix</CODE> - the radix to be used.<DT><B>Returns:</B><DD>the <code>long</code> represented by the string argument in the specified radix.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - if the string does not contain a parsable integer.</DL>
</DD>
</DL>
<HR>
<A NAME="parseLong(java.lang.String)"><!-- --></A><H3>
parseLong</H3>
<PRE>
public static long <B>parseLong</B>(<A HREF="../../java/lang/String.html">String</A> s) throws <A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></PRE>
<DL>
<DD>Parses the string argument as a signed decimal <code>long</code>. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign <code>'-'</code> (<code>\u002d'</code>) to indicate a negative value. The resulting long value is returned, exactly as if the argument and the radix <tt>10</tt> were given as arguments to the <A HREF="../../java/lang/Long.html#parseLong(java.lang.String, int)"><CODE>parseLong(String, int)</CODE></A> method that takes two arguments. <p> Note that neither <tt>L</tt> nor <tt>l</tt> is permitted to appear at the end of the string as a type indicator, as would be permitted in Java programming language source code.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - a string.<DT><B>Returns:</B><DD>the <code>long</code> represented by the argument in decimal.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NumberFormatException.html">NumberFormatException</A></CODE> - if the string does not contain a parsable <code>long</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="longValue()"><!-- --></A><H3>
longValue</H3>
<PRE>
public long <B>longValue</B>()</PRE>
<DL>
<DD>Returns the value of this Long as a long value.<DD><DL>
<DT><B>Returns:</B><DD>the <code>long</code> value represented by this object.</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 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> 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>
<!-- ========= 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/Long.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-all.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>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/lang/Integer.html"><B>PREV CLASS</B></A>
<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>
<A HREF="Long.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="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -