com.adventnet.snmp.snmp2
Class SnmpUnsignedInt

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.SnmpVar
        |
        +--com.adventnet.snmp.snmp2.SnmpUnsignedInt
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SnmpCounter, SnmpGauge, SnmpTimeticks

public class SnmpUnsignedInt
extends SnmpVar

Class of SNMP Unsigned Integer Variable. This class can be used to created an SnmpVar object of type SnmpUnsignedInt. It also has methods to retrieve the value in different forms(eg. long String, byte).

See Also:
Serialized Form

Constructor Summary
SnmpUnsignedInt(long val)
          Constructs a new SnmpUnsignedInt by taking a long type as its argument.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true, if both the SnmpUnsignedInt objects have the same value and false otherwise.
 java.lang.Object getVarObject()
          Returns the value of this SnmpUnsignedInt as a Long object.
 long longValue()
          Returns the value of this SnmpUnsignedInt as a long value.
 byte[] toBytes()
          Returns the value of this SnmpUnsignedInt as raw bytes.
 java.lang.String toString()
          To convert the value of this SnmpUnsignedInt to a printable string used in printing variables.
 java.lang.String toTagString()
          To convert the value of this SnmpUnsignedInt object to a printable string where the type is tagged before the value with a tag UNSIGNED: .
 java.lang.Object toValue()
          Returns the value of this SnmpUnsignedInt as a Long object.
 
Methods inherited from class com.adventnet.snmp.snmp2.SnmpVar
createVariable, getError, getType, getTypeString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpUnsignedInt

public SnmpUnsignedInt(long val)
Constructs a new SnmpUnsignedInt by taking a long type as its argument.
Parameters:
val - the long type for creating a new SnmpUnsignedInt object. The valid values ranges from 0 to 4294967295(both inclusive).
the - unsigned integer value. If this value is given lesser than zero, then it will be taken as zero and if it is given greater than the maximun, then the maximum value will be taken.
Method Detail

getVarObject

public java.lang.Object getVarObject()
Returns the value of this SnmpUnsignedInt as a Long object. This method is the same as toValue().
Overrides:
getVarObject in class SnmpVar
Returns:
the value of this SnmpUnsignedInt as a Long Object Value.

toValue

public java.lang.Object toValue()
Returns the value of this SnmpUnsignedInt as a Long object.
Overrides:
toValue in class SnmpVar
Returns:
the value of this SnmpUnsignedInt as a Long Object Value.

longValue

public long longValue()
Returns the value of this SnmpUnsignedInt as a long value.
Returns:
the value of this SnmpUnsignedInt as a long value.

toString

public java.lang.String toString()
To convert the value of this SnmpUnsignedInt to a printable string used in printing variables.
Overrides:
toString in class SnmpVar
Returns:
the value of this SnmpUnsignedInt as a string Object Value.

toTagString

public java.lang.String toTagString()
To convert the value of this SnmpUnsignedInt object to a printable string where the type is tagged before the value with a tag UNSIGNED: . For e.g if the SnmpUnsignedInt has a value of 1234567, then this method will return - UNSIGNED: 1234567 .
Overrides:
toTagString in class SnmpVar
Returns:
the value of this SnmpUnsignedInt object to a printable string where the type is tagged before the value with a tag UNSIGNED: .

toBytes

public byte[] toBytes()
Returns the value of this SnmpUnsignedInt as raw bytes.
Overrides:
toBytes in class SnmpVar
Returns:
the value of this SnmpUnsignedInt as raw bytes.

equals

public boolean equals(java.lang.Object obj)
Returns true, if both the SnmpUnsignedInt objects have the same value and false otherwise.
Overrides:
equals in class java.lang.Object


Copyright (c)AdventNet Inc., 1996-2004