- java.lang.Object
-
- java.lang.Number
-
- com.aoapps.lang.math.LongLong
-
- All Implemented Interfaces:
Serializable,Comparable<LongLong>
public class LongLong extends Number implements Comparable<LongLong>
128-bit number useful for storing values such as MD5 hashes and IPv6 addresses. This class generally matches the standardjava.lang.Longimplementation.- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intBYTESThe number of bytes used to represent aLongLongvalue in two's complement binary form.static LongLongMAX_VALUEstatic LongLongMIN_VALUEstatic intSIZEThe number of bits used to represent aLongLongvalue in two's complement binary form.
-
Method Summary
-
-
-
Field Detail
-
MIN_VALUE
public static final LongLong MIN_VALUE
-
MAX_VALUE
public static final LongLong MAX_VALUE
-
SIZE
public static final int SIZE
The number of bits used to represent aLongLongvalue in two's complement binary form.- See Also:
- Constant Field Values
-
BYTES
public static final int BYTES
The number of bytes used to represent aLongLongvalue in two's complement binary form.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LongLong
public LongLong(long hi, long lo)
-
LongLong
public LongLong(String s) throws NumberFormatException
- Throws:
NumberFormatException
-
-
Method Detail
-
parseLongLong
public static LongLong parseLongLong(String s, int radix) throws NumberFormatException
- Throws:
NumberFormatException
-
parseLongLong
public static LongLong parseLongLong(String s) throws NumberFormatException
- Throws:
NumberFormatException
-
valueOf
public static LongLong valueOf(String s, int radix) throws NumberFormatException
- Throws:
NumberFormatException- See Also:
parseLongLong(java.lang.String, int)
-
valueOf
public static LongLong valueOf(String s) throws NumberFormatException
- Throws:
NumberFormatException- See Also:
parseLongLong(java.lang.String, int)
-
valueOf
public static LongLong valueOf(long hi, long lo)
-
shortValue
public short shortValue()
- Overrides:
shortValuein classNumber
-
floatValue
public float floatValue()
- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classNumber
-
hashCode
public static int hashCode(long hi, long lo)
-
compareUnsigned
@Deprecated public static int compareUnsigned(long value1, long value2)
Deprecated.Please useLong.compareUnsigned(long, long)as of Java 8.Compares two longs as unsigned.
-
compareTo
public int compareTo(LongLong other)
- Specified by:
compareToin interfaceComparable<LongLong>
-
compareToUnsigned
public int compareToUnsigned(LongLong other)
-
highestOneBit
public LongLong highestOneBit()
-
lowestOneBit
public LongLong lowestOneBit()
-
numberOfLeadingZeros
public int numberOfLeadingZeros()
-
numberOfTrailingZeros
public int numberOfTrailingZeros()
-
bitCount
public int bitCount()
-
rotateLeft
public LongLong rotateLeft(int distance)
TODO: test this.
-
rotateRight
public LongLong rotateRight(int distance)
TODO: test this.
-
reverse
public LongLong reverse()
-
signum
public int signum()
-
reverseBytes
public LongLong reverseBytes()
-
negate
public LongLong negate()
-
getHigh
public long getHigh()
Gets the high-order long.
-
getLow
public long getLow()
Gets the low-order long.
-
-