Class AsnUnsInteger

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

public class AsnUnsInteger extends AsnObject
This class represents ASN.1 32-bit unsigned integer. It is used for TIMETICKS, COUNTER, GAUGE.
Version:
$Revision: 3.16 $ $Date: 2006/01/17 17:43:54 $
Author:
Tim Panton
See Also:
  • Constructor Details

    • AsnUnsInteger

      public AsnUnsInteger(long v)
      Constructor. The type of the AsnUnsInteger defaults to TIMETICKS.
      Parameters:
      v - The value of the AsnUnsInteger
      See Also:
    • AsnUnsInteger

      public AsnUnsInteger(long v, byte t)
      Constructor to create a specific type of AsnUnsInteger.
      Parameters:
      v - The value of the AsnUnsInteger
      t - The type of the AsnUnsInteger
      See Also:
    • AsnUnsInteger

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

    • getValue

      public long getValue()
      Returns the value representation of the AsnUnsInteger.
      Returns:
      The value of the AsnUnsInteger
    • toString

      public String toString()
      Returns the string representation of the AsnUnsInteger.
      Specified by:
      toString in class AsnObject
      Returns:
      The string of the AsnUnsInteger
    • 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 AsnUnsInteger object that contains the same long 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 AsnUnsInteger.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object, equal to the hash of the primitive long value represented by this AsnUnsInteger object.