Class AsnInteger

java.lang.Object
uk.co.westhawk.snmp.stack.AsnObject
uk.co.westhawk.snmp.stack.AsnInteger
All Implemented Interfaces:
SnmpConstants

public class AsnInteger extends AsnObject
This class represents the ASN.1 32-bit signed integer
Version:
$Revision: 3.14 $ $Date: 2008/05/27 15:40:14 $
Author:
Tim Panton
See Also:
  • Constructor Details

    • AsnInteger

      public AsnInteger(int v)
      Constructor.
      Parameters:
      v - The value of the AsnInteger
    • AsnInteger

      public AsnInteger(InputStream in, int len) throws IOException
      Constructor.
      Parameters:
      in - The input stream from which the value should be read
      len - The length of the AsnInteger
      Throws:
      IOException
  • Method Details

    • getValue

      public int getValue()
      Returns the value.
      Returns:
      The value of the AsnInteger
    • toString

      public String toString()
      Returns the string representation of the AsnInteger.
      Specified by:
      toString in class AsnObject
      Returns:
      The string of the AsnInteger
    • equals

      public boolean equals(Object obj)
      Compares this object to the specified object. The result is true if and only if the argument is not null and is an AsnInteger object that contains the same int value as this object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with.
      Returns:
      true if the objects are the same; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code for this AsnInteger.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object, equal to the primitive int value represented by this AsnInteger object.