Package com.oss.asn1
Class UNSIGNED
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.UNSIGNED
- All Implemented Interfaces:
com.oss.asn1.Comparable
,Serializable
,Cloneable
This class is used to represent non-negative (unsigned) 64-bit integer numbers.
- Since:
- ASN.1/Java 6.0
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompute the arithmetic sum of two numbers.clone()
Clone 'this' object.int
Compare 'this' object to another INTEGER (signed) number to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of another object.final int
Compare 'this' object to another UnsignedLong object to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of another object.Returns the result of integer division of this number by another number.boolean
Compares two objects for equality.final boolean
Compare 'this' object to another INTEGER object to see if their contents are the same.Returns the name of ASN.1 type this java class represents.int
hashCode()
Returns a hash code for this objectfinal int
intValue()
Get the value of 'this' object as an int.final long
Get the value of 'this' object as a long.Multiplies this number by another number.Computes the remainder from division of this number by another number.final void
setValue
(int value) Set the value of 'this' object to a short.final void
setValue
(long value) Set the value of 'this' object to a short.final void
setValue
(short value) Set the value of 'this' object to a short.shiftLeft
(int shift) Shifts this number by the specified number of bits to the left.shiftRight
(int shift) Does unsigned shift of this number by the specified number of bits to the right.final short
Get the value of 'this' object as a short.Computes the difference between two numbers.toString()
Converts this unsigned number to a String.Methods inherited from class com.oss.asn1.AbstractData
delete, isEncodable, isPDU, isValid, toString
-
Constructor Details
-
UNSIGNED
public UNSIGNED()The default constructor. -
UNSIGNED
public UNSIGNED(short value) Construct from a short.- Parameters:
value
- the short to set 'this' object to.
-
UNSIGNED
public UNSIGNED(int value) Construct from an int.- Parameters:
value
- the int to set 'this' object to.
-
UNSIGNED
public UNSIGNED(long value) Construct from a long.- Parameters:
value
- the long to set 'this' object to.
-
UNSIGNED
Construct from a String.- Parameters:
value
- the String to set 'this' object to.
-
-
Method Details
-
setValue
public final void setValue(short value) Set the value of 'this' object to a short.- Parameters:
value
- the short value to set 'this' object to.
-
setValue
public final void setValue(int value) Set the value of 'this' object to a short.- Parameters:
value
- the int value to set 'this' object to.
-
setValue
public final void setValue(long value) Set the value of 'this' object to a short.- Parameters:
value
- the long value to set 'this' object to.
-
shortValue
public final short shortValue()Get the value of 'this' object as a short.- Returns:
- short value of 'this' object.
-
intValue
public final int intValue()Get the value of 'this' object as an int.- Returns:
- int value of 'this' object.
-
longValue
public final long longValue()Get the value of 'this' object as a long.- Returns:
- long value of 'this' object.
-
add
Compute the arithmetic sum of two numbers.- Parameters:
o
- the number to add.- Returns:
- the result of addition of this and another numbers.
-
subtract
Computes the difference between two numbers.- Parameters:
o
- specifies another number.- Returns:
- the difference between the biggest of two numbers and another number.
-
multiply
Multiplies this number by another number.- Parameters:
o
- another number- Returns:
- the result of multiplication of this number by 'o'.
-
divide
Returns the result of integer division of this number by another number.- Parameters:
o
- specifies the number to divide by.- Returns:
- the result of division.
-
remainder
Computes the remainder from division of this number by another number.- Parameters:
o
- specifies another number.- Returns:
- the remainder.
-
shiftLeft
Shifts this number by the specified number of bits to the left.- Parameters:
shift
- specifies shift count.- Returns:
- the result of the shift.
-
shiftRight
Does unsigned shift of this number by the specified number of bits to the right.- Parameters:
shift
- specifies the shift count.- Returns:
- the result of the shift.
-
equalTo
Compare 'this' object to another INTEGER object to see if their contents are the same.- Parameters:
that
- the INTEGER object to compare 'this' object to.- Returns:
- true if contents of both objects are the same.
-
compareTo
Compare 'this' object to another UnsignedLong object to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of another object.- Parameters:
that
- INTEGER object that is compared with 'this' object- Returns:
- LESS_THAN, EQUALS, GREATER_THAN values as the results of comparison.
-
compareTo
Compare 'this' object to another INTEGER (signed) number to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of another object.- Parameters:
that
- INTEGER object that is compared with 'this' object- Returns:
- LESS_THAN, EQUALS, GREATER_THAN values as the results of comparison.
-
toString
Converts this unsigned number to a String.- Overrides:
toString
in classAbstractData
- Returns:
- the result of conversion.
-
equals
Compares two objects for equality.- Overrides:
equals
in classAbstractData
- Parameters:
obj
- an object to compare 'this' object with.- Returns:
- boolean value specifying whether or not contents of 'this' and 'that' objects are equal.
-
hashCode
public int hashCode()Returns a hash code for this object- Overrides:
hashCode
in classAbstractData
- Returns:
- a hash code for this object
-
clone
Clone 'this' object.- Returns:
- deep copy of 'this' object.
-
getTypeName
Returns the name of ASN.1 type this java class represents.- Overrides:
getTypeName
in classAbstractData
- Returns:
- the name of the ASN.1 type.
-