|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.protocols.snmp.SnmpInt32
public class SnmpInt32
This class defines the SNMP 32-bit signed integer used by the SNMP SMI. This class also serves as a base class for any additional SNMP SMI types that exits now or may be defined in the future.
| Field Summary | |
|---|---|
static byte |
ASNTYPE
The ASN.1 type as defined by the SNMP SMI specification. |
| Constructor Summary | |
|---|---|
SnmpInt32()
Default constructor. |
|
SnmpInt32(int value)
Constructs a SnmpInt32 object with the passed value. |
|
SnmpInt32(Integer value)
Constructs a SnmpInt32 object with the specified value. |
|
SnmpInt32(SnmpInt32 second)
Class copy constructor. |
|
SnmpInt32(String value)
Simple class constructor that attempts to parse the passed string into a valid integer value. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a duplicate of the current object. |
int |
decodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Used to decode the integer value from the ASN.1 buffer. |
SnmpSyntax |
duplicate()
Returns a duplicate of the current object. |
int |
encodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Used to encode the integer value into an ASN.1 buffer. |
boolean |
equals(Object obj)
|
int |
getValue()
Used to access the internal 32-bit signed quantity. |
int |
hashCode()
|
void |
setValue(int value)
Used to set the 32-bit signed quantity |
void |
setValue(Integer value)
Used to set the 32-bit signed quantity |
static Integer |
toInteger(SnmpInt32 val)
|
String |
toString()
Returns the string representation of the object. |
byte |
typeId()
Used to retreive the ASN.1 type for this object. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final byte ASNTYPE
| Constructor Detail |
|---|
public SnmpInt32()
public SnmpInt32(int value)
value - The 32-bit signed integer value for the object.public SnmpInt32(Integer value)
value - An Integer object containing the 32-bte value.public SnmpInt32(SnmpInt32 second)
second - The object to get the value from.public SnmpInt32(String value)
value - The integer value represented as a String
NumberFormatException - Thrown if the passed value cannot be turned into a valid
integer.
NullPointerException - Thrown if the passed string is a null reference.| Method Detail |
|---|
public int getValue()
public void setValue(int value)
value - The new value for the object.public void setValue(Integer value)
value - The new value for the objectpublic byte typeId()
typeId in interface SnmpSyntax
public int encodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
throws AsnEncodingException
encodeASN in interface SnmpSyntaxbuf - The location to write the encoded dataoffset - The start of the encoded buffer.encoder - The ASN.1 encoder object
AsnEncodingException - Thrown if an encoding error occurs
public int decodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
throws AsnDecodingException
decodeASN in interface SnmpSyntaxbuf - The encoded ASN.1 dataoffset - The offset of the first byte of dataencoder - The ASN.1 decoder object.
AsnDecodingException - Thrown if an encoding error occurspublic SnmpSyntax duplicate()
duplicate in interface SnmpSyntaxpublic Object clone()
clone in class Objectpublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic static Integer toInteger(SnmpInt32 val)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||