HOME

com.ireasoning.protocol.snmp
Class SnmpInt

java.lang.Object
  extended bycom.ireasoning.protocol.snmp.SnmpInt
All Implemented Interfaces:
Msg, Serializable, SnmpDataType

public class SnmpInt
extends Object
implements SnmpDataType

This class represents 32-bit Snmp integer. The integer type represents integer-valued information between -2^31 and 2^31-1 inclusive (-2147483648 to 2147483647 decimal).

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.ireasoning.protocol.snmp.SnmpDataType
BITS, BITSTRING, COUNTER32, COUNTER64, END_OF_MIB_VIEW, END_OF_MIB_VIEW_OBJECT, GAUGE32, INTEGER, IPADDRESS, NO_SUCH_INSTANCE, NO_SUCH_INSTANCE_OBJECT, NO_SUCH_OBJECT, NO_SUCH_OBJECT_OBJECT, NULL, OCTETSTRING, OID, OPAQUE, PDU, SEQUENCE, SEQUENCEOF, serialVersionUID, TIMETICKS, UNSIGNED32, VARBIND
 
Fields inherited from interface com.ireasoning.protocol.Msg
ERROR_TYPE
 
Constructor Summary
SnmpInt()
          Default constructor
SnmpInt(int i)
          Constructs an SnmpInt object with passed integer i
SnmpInt(Integer i)
          Constructs an SnmpInt object with passed integer i
SnmpInt(SnmpInt i)
          Makes a copy of passed snmpInt32 object
SnmpInt(String str)
          Constructs an SnmpInt object with passed String str
 
Method Summary
 SnmpDataType copy()
          Makes a copy of itself
 int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
          For internal use
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 int getType()
          Returns SnmpDataType.INTEGER
 String getTypeString()
          Returns "Integer"
 int getValue()
          Returns the integer value of this class
 int hashCode()
          Returns a hash code value for the object
 void setValue(int value)
          Sets a new value
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpInt

public SnmpInt()
Default constructor


SnmpInt

public SnmpInt(int i)
Constructs an SnmpInt object with passed integer i


SnmpInt

public SnmpInt(Integer i)
Constructs an SnmpInt object with passed integer i


SnmpInt

public SnmpInt(String str)
Constructs an SnmpInt object with passed String str


SnmpInt

public SnmpInt(SnmpInt i)
Makes a copy of passed snmpInt32 object

Method Detail

getValue

public int getValue()
Returns the integer value of this class

Returns:
the integer value of this class

setValue

public void setValue(int value)
Sets a new value


toString

public String toString()

copy

public SnmpDataType copy()
Description copied from interface: SnmpDataType
Makes a copy of itself

Specified by:
copy in interface SnmpDataType
Returns:
a deep copy of this object

encode

public int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
           throws SnmpEncodingException
Description copied from interface: SnmpDataType
For internal use

Specified by:
encode in interface SnmpDataType
Throws:
SnmpEncodingException

getType

public int getType()
Returns SnmpDataType.INTEGER

Specified by:
getType in interface SnmpDataType
Returns:
the object data type

getTypeString

public String getTypeString()
Returns "Integer"

Specified by:
getTypeString in interface SnmpDataType

equals

public boolean equals(Object obj)
Description copied from interface: SnmpDataType
Indicates whether some other object is "equal to" this one.

Specified by:
equals in interface SnmpDataType

hashCode

public int hashCode()
Description copied from interface: SnmpDataType
Returns a hash code value for the object

Specified by:
hashCode in interface SnmpDataType

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.