|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.protocols.snmp.SnmpUInt32
public class SnmpUInt32
This class defines the 32-bit unsigned SNMP object used to transmit 32-bit unsigned number. The unsigned value is represented by a 64-bit quantity, but the upper 32-bits are always truncated from the value. If a caller passes in a value with any the upper 32-bits set the value will be silently truncated to a 32-bit value. If negative quantities or values with more than 32-bits are passed then data corruption will occur.
| Field Summary | |
|---|---|
static byte |
ASNTYPE
The ASN.1 value for an unsigned integer value. |
| Constructor Summary | |
|---|---|
SnmpUInt32()
Default class constructor. |
|
SnmpUInt32(long value)
Constructs a SnmpUInt32 object with the specified value. |
|
SnmpUInt32(Long value)
Constructs a SnmpUInt32 object with the specified value. |
|
SnmpUInt32(SnmpUInt32 second)
Class copy constructor. |
|
SnmpUInt32(String value)
Simple class constructor that recovers the unsigned value from the passed string. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a duplicte 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 duplicte 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)
|
long |
getValue()
Used to retreive the 32-bit unsigned value. |
int |
hashCode()
|
void |
setValue(long value)
Used to set the 32-bit unsigned quantity. |
void |
setValue(Long value)
Used to set the 32-bit unsigned quantity. |
static Long |
toLong(SnmpUInt32 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 SnmpUInt32()
public SnmpUInt32(long value)
value - The new 32-bit value.public SnmpUInt32(Long value)
value - The new 32-bit value.public SnmpUInt32(SnmpUInt32 second)
second - The object to copy the value from.public SnmpUInt32(String value)
value - The unsigned value encoded as a string.
NullPointerException - Thrown if the passed value is a null pointer.
IllegalArgumentException - Thrown if the decoded value evaluates to a negative value.
NumberFormatException - Throws in the passed value cannot be decoded by the
constructor.| Method Detail |
|---|
public long getValue()
public void setValue(long value)
value - The new value for the objectpublic void setValue(Long 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 Long toLong(SnmpUInt32 val)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||