java.lang.Object
java.lang.Number
com.aoapps.lang.math.LongLong
- All Implemented Interfaces:
Serializable
,Comparable<LongLong>
128-bit number useful for storing values such as MD5 hashes and IPv6 addresses.
This class generally matches the standard
java.lang.Long
implementation.- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
bitCount()
byte
int
int
compareToUnsigned
(LongLong other) static int
compareUnsigned
(long value1, long value2) Deprecated.double
boolean
float
long
getHigh()
Gets the high-order long.long
getLow()
Gets the low-order long.int
hashCode()
static int
hashCode
(long hi, long lo) int
intValue()
long
negate()
int
int
static LongLong
static LongLong
parseLongLong
(String s, int radix) reverse()
rotateLeft
(int distance) TODO: test this.rotateRight
(int distance) TODO: test this.short
int
signum()
toString()
static LongLong
valueOf
(long hi, long lo) static LongLong
static LongLong
-
Field Details
-
Constructor Details
-
LongLong
public LongLong(long hi, long lo) -
LongLong
- Throws:
NumberFormatException
-
-
Method Details
-
parseLongLong
- Throws:
NumberFormatException
-
parseLongLong
- Throws:
NumberFormatException
-
valueOf
- Throws:
NumberFormatException
- See Also:
-
valueOf
- Throws:
NumberFormatException
- See Also:
-
valueOf
-
byteValue
public byte byteValue() -
shortValue
public short shortValue()- Overrides:
shortValue
in classNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
toString
-
hashCode
public static int hashCode(long hi, long lo) -
hashCode
public int hashCode() -
equals
-
compareUnsigned
Deprecated.Please useLong.compareUnsigned(long, long)
as of Java 8.Compares two longs as unsigned. -
compareTo
- Specified by:
compareTo
in interfaceComparable<LongLong>
-
compareToUnsigned
-
highestOneBit
-
lowestOneBit
-
numberOfLeadingZeros
public int numberOfLeadingZeros() -
numberOfTrailingZeros
public int numberOfTrailingZeros() -
bitCount
public int bitCount() -
rotateLeft
TODO: test this. -
rotateRight
TODO: test this. -
reverse
-
signum
public int signum() -
reverseBytes
-
negate
-
getHigh
public long getHigh()Gets the high-order long. -
getLow
public long getLow()Gets the low-order long.
-
Long.compareUnsigned(long, long)
as of Java 8.