Java Doc for Long.java in  » Apache-Harmony-Java-SE » java-package » java » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.Number
      java.lang.Long

Long
final public class Long extends Number implements Comparable<Long>(Code)

Long is the wrapper for the primitive type long.

As with the specification, this implementation relied on code laid out in Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002) as well as The Aggregate's Magic Algorithms.


See Also:   java.lang.Number
since:
   1.0

Inner Class :static class valueOfCache

Field Summary
final public static  longMAX_VALUE
    

Constant for the maximum long value, 263-1.

final public static  longMIN_VALUE
    

Constant for the minimum long value, -231.

final public static  intSIZE
    

Constant for the number of bits to represent a long in two's compliment form.

final public static  Class<Long>TYPE
     The java.lang.Class that represents this class.

Constructor Summary
public  Long(long value)
     Constructs a new instance of the receiver which represents the long valued argument.
public  Long(String string)
     Constructs a new instance of this class given a string.

Method Summary
public static  intbitCount(long lng)
    

Counts the number of 1 bits in the long value passed; this is sometimes referred to as a population count.


Parameters:
  lng - The long value to process.
public  bytebyteValue()
    
public  intcompareTo(Long object)
    

Compares this Long to the Long passed.

public static  Longdecode(String string)
     Parses the string argument as if it was a long value and returns the result.
public  doubledoubleValue()
    
public  booleanequals(Object o)
     Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
public  floatfloatValue()
    
public static  LonggetLong(String string)
     Answers a Long representing the long value of the property named by the argument.
public static  LonggetLong(String string, long defaultValue)
     Answers a Long representing the long value of the property named by the argument.
public static  LonggetLong(String string, Long defaultValue)
     Answers an Long representing the long value of the property named by the argument.
public  inthashCode()
     Answers an integer hash code for the receiver.
public static  longhighestOneBit(long lng)
    

Determines the highest (leftmost) bit that is 1 and returns the value that is the bit mask for that bit.

public  intintValue()
    
public  longlongValue()
    
public static  longlowestOneBit(long lng)
    

Determines the lowest (rightmost) bit that is 1 and returns the value that is the bit mask for that bit.

public static  intnumberOfLeadingZeros(long lng)
    

Determines the number of leading zeros in the long passed prior to the Long.highestOneBit(long) highest one bit .


Parameters:
  lng - The long to process.
public static  intnumberOfTrailingZeros(long lng)
    

Determines the number of trailing zeros in the long passed after the Long.lowestOneBit(long) lowest one bit .


Parameters:
  lng - The long to process.
public static  longparseLong(String string)
     Parses the string argument as if it was a long value and returns the result.
public static  longparseLong(String string, int radix)
     Parses the string argument as if it was an long value and returns the result.
public static  longreverse(long lng)
    

Reverses the bytes of a long.


Parameters:
  lng - The long to reverse.
public static  longreverseBytes(long lng)
    

Reverses the bytes of a long.


Parameters:
  lng - The long to reverse.
public static  longrotateLeft(long lng, int distance)
    

Rotates the bits of lng to the left by the distance bits.


Parameters:
  lng - The long value to rotate left.
Parameters:
  distance - The number of bits to rotate.
public static  longrotateRight(long lng, int distance)
    

Rotates the bits of lng to the right by the distance bits.


Parameters:
  lng - The long value to rotate right.
Parameters:
  distance - The number of bits to rotate.
public  shortshortValue()
    
public static  intsignum(long lng)
    

The signum function for long values.

public static  StringtoBinaryString(long l)
     Answers a string containing '0' and '1' characters which describe the binary representation of the argument.
public static  StringtoHexString(long l)
     Answers a string containing characters in the range 0..7, a..f which describe the hexadecimal representation of the argument.
public static  StringtoOctalString(long l)
     Answers a string containing characters in the range 0..7 which describe the octal representation of the argument.
public  StringtoString()
     Answers a string containing a concise, human-readable description of the receiver.
public static  StringtoString(long l)
     Answers a string containing characters in the range 0..9 which describe the decimal representation of the argument.
public static  StringtoString(long l, int radix)
     Answers a string containing characters in the range 0..9, a..z (depending on the radix) which describe the representation of the argument in that radix.
Parameters:
  l - a long to get the representation of
Parameters:
  radix - the base to use for conversion.
public static  LongvalueOf(String string)
     Parses the string argument as if it was an long value and returns the result.
public static  LongvalueOf(String string, int radix)
     Parses the string argument as if it was an long value and returns the result.
public static  LongvalueOf(long lng)
    

Returns a Long instance for the long value passed.


Field Detail
MAX_VALUE
final public static long MAX_VALUE(Code)

Constant for the maximum long value, 263-1.




MIN_VALUE
final public static long MIN_VALUE(Code)

Constant for the minimum long value, -231.




SIZE
final public static int SIZE(Code)

Constant for the number of bits to represent a long in two's compliment form.


since:
   1.5



TYPE
final public static Class<Long> TYPE(Code)
The java.lang.Class that represents this class.




Constructor Detail
Long
public Long(long value)(Code)
Constructs a new instance of the receiver which represents the long valued argument.
Parameters:
  value - the long to store in the new instance.



Long
public Long(String string) throws NumberFormatException(Code)
Constructs a new instance of this class given a string.
Parameters:
  string - a string representation of an long quantity.
exception:
  NumberFormatException - if the argument could not be parsed as a long quantity.




Method Detail
bitCount
public static int bitCount(long lng)(Code)

Counts the number of 1 bits in the long value passed; this is sometimes referred to as a population count.


Parameters:
  lng - The long value to process. The number of 1 bits.
since:
   1.5



byteValue
public byte byteValue()(Code)
Answers the byte value which the receiver represents byte the value of the receiver.



compareTo
public int compareTo(Long object)(Code)

Compares this Long to the Long passed. If this instance's value is equal to the value of the instance passed, then 0 is returned. If this instance's value is less than the value of the instance passed, then a negative value is returned. If this instance's value is greater than the value of the instance passed, then a positive value is returned.


Parameters:
  object - The instance to compare to.
throws:
  NullPointerException - if object is null.
since:
   1.2



decode
public static Long decode(String string) throws NumberFormatException(Code)
Parses the string argument as if it was a long value and returns the result. Throws NumberFormatException if the string does not represent a long quantity. The string may be a hexadecimal ("0x..."), octal ("0..."), or decimal ("...") representation of a long.
Parameters:
  string - a string representation of an long quantity. Long the value represented by the argument
exception:
  NumberFormatException - if the argument could not be parsed as an long quantity.



doubleValue
public double doubleValue()(Code)
Answers the double value which the receiver represents double the value of the receiver.



equals
public boolean equals(Object o)(Code)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.

In this case, the argument must also be an Long, and the receiver and argument must represent the same long value.
Parameters:
  o - the object to compare with this object true if the object is the same as this objectfalse if it is different from this object
See Also:   Long.hashCode




floatValue
public float floatValue()(Code)
Answers the float value which the receiver represents float the value of the receiver.



getLong
public static Long getLong(String string)(Code)
Answers a Long representing the long value of the property named by the argument. If the property could not be found, or its value could not be parsed as a long, answer null.
Parameters:
  string - The name of the desired integer property. Long A Long representing the value of the property.



getLong
public static Long getLong(String string, long defaultValue)(Code)
Answers a Long representing the long value of the property named by the argument. If the property could not be found, or its value could not be parsed as a long, answer a Long representing the second argument.
Parameters:
  string - The name of the desired long property. Long An Long representing the value of the property.



getLong
public static Long getLong(String string, Long defaultValue)(Code)
Answers an Long representing the long value of the property named by the argument. If the property could not be found, or its value could not be parsed as an long, answer the second argument.
Parameters:
  string - The name of the desired long property. Long An Long representing the value of the property.



hashCode
public int hashCode()(Code)
Answers an integer hash code for the receiver. Any two objects which answer true when passed to equals must answer the same value for this method. the receiver's hash
See Also:   Long.equals



highestOneBit
public static long highestOneBit(long lng)(Code)

Determines the highest (leftmost) bit that is 1 and returns the value that is the bit mask for that bit. This is sometimes referred to as the Most Significant 1 Bit.


Parameters:
  lng - The long to interrogate. The bit mask indicating the highest 1 bit.
since:
   1.5



intValue
public int intValue()(Code)
Answers the int value which the receiver represents int the value of the receiver.



longValue
public long longValue()(Code)
Answers the long value which the receiver represents long the value of the receiver.



lowestOneBit
public static long lowestOneBit(long lng)(Code)

Determines the lowest (rightmost) bit that is 1 and returns the value that is the bit mask for that bit. This is sometimes referred to as the Least Significant 1 Bit.


Parameters:
  lng - The long to interrogate. The bit mask indicating the lowest 1 bit.
since:
   1.5



numberOfLeadingZeros
public static int numberOfLeadingZeros(long lng)(Code)

Determines the number of leading zeros in the long passed prior to the Long.highestOneBit(long) highest one bit .


Parameters:
  lng - The long to process. The number of leading zeros.
since:
   1.5



numberOfTrailingZeros
public static int numberOfTrailingZeros(long lng)(Code)

Determines the number of trailing zeros in the long passed after the Long.lowestOneBit(long) lowest one bit .


Parameters:
  lng - The long to process. The number of trailing zeros.
since:
   1.5



parseLong
public static long parseLong(String string) throws NumberFormatException(Code)
Parses the string argument as if it was a long value and returns the result. Throws NumberFormatException if the string does not represent a long quantity.
Parameters:
  string - a string representation of a long quantity. long the value represented by the argument
exception:
  NumberFormatException - if the argument could not be parsed as a long quantity.



parseLong
public static long parseLong(String string, int radix) throws NumberFormatException(Code)
Parses the string argument as if it was an long value and returns the result. Throws NumberFormatException if the string does not represent an long quantity. The second argument specifies the radix to use when parsing the value.
Parameters:
  string - a string representation of an long quantity.
Parameters:
  radix - the base to use for conversion. long the value represented by the argument
exception:
  NumberFormatException - if the argument could not be parsed as an long quantity.



reverse
public static long reverse(long lng)(Code)

Reverses the bytes of a long.


Parameters:
  lng - The long to reverse. The reversed value.
since:
   1.5



reverseBytes
public static long reverseBytes(long lng)(Code)

Reverses the bytes of a long.


Parameters:
  lng - The long to reverse. The reversed value.
since:
   1.5



rotateLeft
public static long rotateLeft(long lng, int distance)(Code)

Rotates the bits of lng to the left by the distance bits.


Parameters:
  lng - The long value to rotate left.
Parameters:
  distance - The number of bits to rotate. The rotated value.
since:
   1.5



rotateRight
public static long rotateRight(long lng, int distance)(Code)

Rotates the bits of lng to the right by the distance bits.


Parameters:
  lng - The long value to rotate right.
Parameters:
  distance - The number of bits to rotate. The rotated value.
since:
   1.5



shortValue
public short shortValue()(Code)
Answers the short value which the receiver represents short the value of the receiver.



signum
public static int signum(long lng)(Code)

The signum function for long values. This method returns -1 for negative values, 1 for positive values and 0 for the value 0.


Parameters:
  lng - The long value. -1 if negative, 1 if positive otherwise 0.
since:
   1.5



toBinaryString
public static String toBinaryString(long l)(Code)
Answers a string containing '0' and '1' characters which describe the binary representation of the argument.
Parameters:
  l - a long to get the binary representation of String the binary representation of the argument



toHexString
public static String toHexString(long l)(Code)
Answers a string containing characters in the range 0..7, a..f which describe the hexadecimal representation of the argument.
Parameters:
  l - a long to get the hex representation of String the hex representation of the argument



toOctalString
public static String toOctalString(long l)(Code)
Answers a string containing characters in the range 0..7 which describe the octal representation of the argument.
Parameters:
  l - a long to get the octal representation of String the octal representation of the argument



toString
public String toString()(Code)
Answers a string containing a concise, human-readable description of the receiver. a printable representation for the receiver.



toString
public static String toString(long l)(Code)
Answers a string containing characters in the range 0..9 which describe the decimal representation of the argument.
Parameters:
  l - a long to get the representation of String the representation of the argument



toString
public static String toString(long l, int radix)(Code)
Answers a string containing characters in the range 0..9, a..z (depending on the radix) which describe the representation of the argument in that radix.
Parameters:
  l - a long to get the representation of
Parameters:
  radix - the base to use for conversion. String the representation of the argument



valueOf
public static Long valueOf(String string) throws NumberFormatException(Code)
Parses the string argument as if it was an long value and returns the result. Throws NumberFormatException if the string does not represent an long quantity.
Parameters:
  string - a string representation of an long quantity. Long the value represented by the argument
exception:
  NumberFormatException - if the argument could not be parsed as an long quantity.



valueOf
public static Long valueOf(String string, int radix) throws NumberFormatException(Code)
Parses the string argument as if it was an long value and returns the result. Throws NumberFormatException if the string does not represent an long quantity. The second argument specifies the radix to use when parsing the value.
Parameters:
  string - a string representation of an long quantity.
Parameters:
  radix - the base to use for conversion. Long the value represented by the argument
exception:
  NumberFormatException - if the argument could not be parsed as an long quantity.



valueOf
public static Long valueOf(long lng)(Code)

Returns a Long instance for the long value passed. This method is preferred over the constructor, as this method may maintain a cache of instances.


Parameters:
  lng - The long value. A Long instance.
since:
   1.5



Methods inherited from java.lang.Number
public byte byteValue()(Code)(Java Doc)
abstract public double doubleValue()(Code)(Java Doc)
abstract public float floatValue()(Code)(Java Doc)
abstract public int intValue()(Code)(Java Doc)
abstract public long longValue()(Code)(Java Doc)
public short shortValue()(Code)(Java Doc)

Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.