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.String getNumericValueAsString()
          This method returns the numeric value of the UNSIGNED32 data type in decimal ( base 10 ) format.
 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).
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().

Specified by:
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.

Specified by:
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.

Specified by:
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 .

Specified by:
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.

Specified by:
toBytes in class SnmpVar
Returns:
the value of this SnmpUnsignedInt as raw bytes.

getNumericValueAsString

public java.lang.String getNumericValueAsString()
This method returns the numeric value of the UNSIGNED32 data type in decimal ( base 10 ) format.

Overrides:
getNumericValueAsString in class SnmpVar
Returns:
The numeric value of the UNSIGNED32 type in decimal format.

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-2006