public class SnmpUInt32 extends java.lang.Object implements SnmpSyntax, java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static byte |
ASNTYPE
The ASN.1 value for an unsigned integer value.
|
private long |
m_value
The internal 32-bit unsigned quantity
implemented as a 64-bit signed quantity
|
private static long |
MASK
The 32-bit mask to be BITWISE AND with all values
to ensure that only the lower 32-bits are set.
|
(package private) static long |
serialVersionUID
defines the serialization version
|
Constructor and Description |
---|
SnmpUInt32()
Default class constructor.
|
SnmpUInt32(long value)
Constructs a SnmpUInt32 object with the specified value.
|
SnmpUInt32(java.lang.Long value)
Constructs a SnmpUInt32 object with the specified value.
|
SnmpUInt32(SnmpUInt32 second)
Class copy constructor.
|
SnmpUInt32(java.lang.String value)
Simple class constructor that recovers the unsigned value from
the passed string.
|
Modifier and Type | Method and Description |
---|---|
java.lang.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.
|
long |
getValue()
Used to retreive the 32-bit unsigned value.
|
void |
setValue(long value)
Used to set the 32-bit unsigned quantity.
|
void |
setValue(java.lang.Long value)
Used to set the 32-bit unsigned quantity.
|
java.lang.String |
toString()
Returns the string representation of the object.
|
byte |
typeId()
Used to retreive the ASN.1 type for this object.
|
static final long serialVersionUID
private long m_value
private static final long MASK
public static final byte ASNTYPE
public SnmpUInt32()
public SnmpUInt32(long value)
value
- The new 32-bit value.public SnmpUInt32(java.lang.Long value)
value
- The new 32-bit value.public SnmpUInt32(SnmpUInt32 second)
second
- The object to copy the value from.public SnmpUInt32(java.lang.String value)
value
- The unsigned value encoded as a string.java.lang.NullPointerException
- Thrown if the passed value
is a null pointer.java.lang.IllegalArgumentException
- Thrown if the decoded value
evaluates to a negative value.java.lang.NumberFormatException
- Throws in the passed value cannot
be decoded by the constructor.public long getValue()
public void setValue(long value)
value
- The new value for the objectpublic void setValue(java.lang.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 SnmpSyntax
buf
- The location to write the encoded dataoffset
- The start of the encoded buffer.encoder
- The ASN.1 encoder objectAsnEncodingException
- Thrown if an encoding error occurspublic int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingException
decodeASN
in interface SnmpSyntax
buf
- 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 SnmpSyntax
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Generated by iurt on 2015.