Package com.oss.asn1
Class INTEGER
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.INTEGER
- All Implemented Interfaces:
com.oss.asn1.Comparable
,Serializable
,Cloneable
The INTEGER class represents the ASN.1 INTEGER type.
- Since:
- ASN.1/Java 1.0-beta A
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Compare 'this' object to another INTEGER object to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of another object.final boolean
Compare 'this' object to another INTEGER object to see if their contents are the same.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.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.final short
Get the value of 'this' object as a short.Methods inherited from class com.oss.asn1.AbstractData
clone, delete, equals, isEncodable, isPDU, isValid, toString, toString
-
Constructor Details
-
INTEGER
public INTEGER()The default constructor. -
INTEGER
public INTEGER(short value) Construct from a short.- Parameters:
value
- the short to set 'this' object to.
-
INTEGER
public INTEGER(int value) Construct from an int.- Parameters:
value
- the int to set 'this' object to.
-
INTEGER
public INTEGER(long value) Construct from a long.- Parameters:
value
- the long 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.
-
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 INTEGER 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.
-
hashCode
public int hashCode()Returns a hash code for this object- Overrides:
hashCode
in classAbstractData
- Returns:
- a hash code for this object
-