Package com.sshtools.common.util
Class UnsignedInteger32
java.lang.Object
com.sshtools.common.util.UnsignedInteger32
This class provides a 32bit unsigned integer.
- Author:
- Lee David Painter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe maximum value of a 32bit unsigned integerstatic final longThe minimum value of a 32bit unsigned integerstatic final UnsignedInteger32 -
Constructor Summary
ConstructorsConstructorDescriptionUnsignedInteger32(long a) Creates a new UnsignedInteger32 object.Creates a new UnsignedInteger32 object. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnsignedInteger32add(UnsignedInteger32 x, long y) Add an int to an unsigned integer.static UnsignedInteger32Add two unsigned integers together.static UnsignedInteger32deduct(UnsignedInteger32 x, long y) static UnsignedInteger32booleanCompares an object.inthashCode()Returns the objects hash code.intintValue()Returns the long value of the unsigned integer cast to an intlongReturns the long value of this unsigned integer.toString()Returns a String representation of the unsigned integer.
-
Field Details
-
MAX_VALUE
public static final long MAX_VALUEThe maximum value of a 32bit unsigned integer- See Also:
-
MIN_VALUE
public static final long MIN_VALUEThe minimum value of a 32bit unsigned integer- See Also:
-
ZERO
-
-
Constructor Details
-
UnsignedInteger32
public UnsignedInteger32(long a) Creates a new UnsignedInteger32 object.- Parameters:
a-- Throws:
NumberFormatException
-
UnsignedInteger32
Creates a new UnsignedInteger32 object.- Parameters:
a-- Throws:
NumberFormatException
-
-
Method Details
-
intValue
public int intValue()Returns the long value of the unsigned integer cast to an int- Returns:
-
longValue
public long longValue()Returns the long value of this unsigned integer.- Returns:
-
toString
Returns a String representation of the unsigned integer. -
hashCode
public int hashCode()Returns the objects hash code. -
equals
Compares an object. -
add
Add two unsigned integers together.- Parameters:
x-y-- Returns:
- UnsignedInteger32
-
add
Add an int to an unsigned integer.- Parameters:
x-y-- Returns:
- UnsignedInteger32
-
deduct
-
deduct
-