Package com.oss.asn1

Class INTEGER

All Implemented Interfaces:
com.oss.asn1.Comparable, Serializable, Cloneable

public class INTEGER extends AbstractData implements com.oss.asn1.Comparable
The INTEGER class represents the ASN.1 INTEGER type.
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
    Constructor
    Description
    The default constructor.
    INTEGER(int value)
    Construct from an int.
    INTEGER(long value)
    Construct from a long.
    INTEGER(short value)
    Construct from a short.
  • Method Summary

    Modifier and Type
    Method
    Description
    Clone 'this' object.
    final 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.
    Returns the name of ASN.1 type this java class represents.
    int
    Returns a hash code for this object
    final int
    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

    delete, equals, isEncodable, isPDU, isValid, toString, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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

    • clone

      public INTEGER clone()
      Clone 'this' object.
      Returns:
      deep copy of 'this' object.
    • 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

      public final boolean equalTo(INTEGER that)
      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

      public final int compareTo(INTEGER that)
      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 class AbstractData
      Returns:
      a hash code for this object
    • getTypeName

      public String getTypeName()
      Returns the name of ASN.1 type this java class represents.
      Overrides:
      getTypeName in class AbstractData
      Returns:
      the name of the ASN.1 type.