Package com.sshtools.common.util
Class UnsignedInteger64
java.lang.Object
com.sshtools.common.util.UnsignedInteger64
This class provides a 64bit unsigned integer.
- Author:
- Lee David Painter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BigIntegerstatic final BigIntegerstatic final UnsignedInteger64static final UnsignedInteger64 -
Constructor Summary
ConstructorsConstructorDescriptionUnsignedInteger64(byte[] bval) Creates a new UnsignedInteger64 object.UnsignedInteger64(long value) UnsignedInteger64(String sval) Creates a new UnsignedInteger64 object.UnsignedInteger64(BigInteger input) Creates a new UnsignedInteger64 object. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnsignedInteger64add(UnsignedInteger64 x, int y) Add an unsigned integer to an int.static UnsignedInteger64Add an unsigned integer to another unsigned integer.Return a BigInteger value of the unsigned integer.booleanCompares this unsigned integer to an object.inthashCode()Return the objects hash code.longReturn a long value of the unsigned integer.byte[]Returns a byte array encoded with the unsigned integer.toString()Return a String representation of the unsigned integer
-
Field Details
-
ZERO
-
ONE
-
MAX_VALUE
-
MIN_VALUE
-
-
Constructor Details
-
UnsignedInteger64
Creates a new UnsignedInteger64 object.- Parameters:
sval-- Throws:
NumberFormatException
-
UnsignedInteger64
Creates a new UnsignedInteger64 object.- Parameters:
bval-- Throws:
NumberFormatException
-
UnsignedInteger64
public UnsignedInteger64(long value) -
UnsignedInteger64
Creates a new UnsignedInteger64 object.- Parameters:
input-- Throws:
NumberFormatException
-
-
Method Details
-
equals
Compares this unsigned integer to an object. -
bigIntValue
Return a BigInteger value of the unsigned integer.- Returns:
-
longValue
public long longValue()Return a long value of the unsigned integer.- Returns:
-
toString
Return a String representation of the unsigned integer -
hashCode
public int hashCode()Return the objects hash code. -
add
Add an unsigned integer to another unsigned integer.- Parameters:
x-y-- Returns:
-
add
Add an unsigned integer to an int.- Parameters:
x-y-- Returns:
-
toByteArray
public byte[] toByteArray()Returns a byte array encoded with the unsigned integer.- Returns:
-