public class UnsignedInteger32 extends AbstractVariable implements AssignableFromLong, AssignableFromString
Modifier and Type | Field and Description |
---|---|
protected long |
value |
SMISYNTAXES_PROPERTIES
Constructor and Description |
---|
UnsignedInteger32() |
UnsignedInteger32(byte signedByteValue)
Creates an unsigned integer from a signed byte value.
|
UnsignedInteger32(int signedIntValue)
Creates an unsigned integer from a signed int value.
|
UnsignedInteger32(long value)
Creates an
UnsignedInteger32 from a long value. |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this variable.
|
int |
compareTo(Variable o) |
void |
decodeBER(BERInputStream inputStream)
Decodes a
Variable from an InputStream . |
void |
encodeBER(OutputStream outputStream)
Encodes a
Variable to an OutputStream . |
boolean |
equals(Object o) |
void |
fromSubIndex(OID subIndex,
boolean impliedLength)
Sets the value of this
Variable from the supplied (sub-)index. |
int |
getBERLength()
Returns the length of this
Variable in bytes when encoded
according to the Basic Encoding Rules (BER). |
int |
getSyntax()
Gets the ASN.1 syntax identifier value of this SNMP variable.
|
long |
getValue() |
int |
hashCode() |
void |
setValue(long value) |
void |
setValue(String value) |
int |
toInt()
Returns an integer representation of this variable if
such a representation exists.
|
long |
toLong()
Returns a long representation of this variable if
such a representation exists.
|
String |
toString()
Gets a string representation of the variable.
|
OID |
toSubIndex(boolean impliedLength)
Converts the value of this
Variable to a (sub-)index
value. |
createFromBER, createFromSyntax, equal, getBERPayloadLength, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isException
public UnsignedInteger32()
public UnsignedInteger32(long value)
UnsignedInteger32
from a long
value.value
- a long
value which must not be greater 2^32-1 and not less
zero.IllegalArgumentException
- if value
< 0 or > 2^32-1.public UnsignedInteger32(int signedIntValue)
signedIntValue
- a signed int value.public UnsignedInteger32(byte signedByteValue)
signedByteValue
- a signed byte value.public void encodeBER(OutputStream outputStream) throws IOException
AbstractVariable
Variable
to an OutputStream
.encodeBER
in interface BERSerializable
encodeBER
in class AbstractVariable
outputStream
- an OutputStream
.IOException
- if an error occurs while writing to the stream.public void decodeBER(BERInputStream inputStream) throws IOException
AbstractVariable
Variable
from an InputStream
.decodeBER
in interface BERSerializable
decodeBER
in class AbstractVariable
inputStream
- an InputStream
containing a BER encoded byte stream.IOException
- if the stream could not be decoded by using BER rules.public int getSyntax()
AbstractVariable
getSyntax
in interface Variable
getSyntax
in class AbstractVariable
public int hashCode()
hashCode
in interface Variable
hashCode
in class AbstractVariable
public int getBERLength()
AbstractVariable
Variable
in bytes when encoded
according to the Basic Encoding Rules (BER).getBERLength
in interface BERSerializable
getBERLength
in class AbstractVariable
public boolean equals(Object o)
equals
in interface Variable
equals
in class AbstractVariable
public int compareTo(Variable o)
compareTo
in interface Comparable<Variable>
compareTo
in interface Variable
compareTo
in class AbstractVariable
public String toString()
AbstractVariable
toString
in interface Variable
toString
in class AbstractVariable
public void setValue(String value)
setValue
in interface AssignableFromString
public void setValue(long value)
setValue
in interface AssignableFromLong
public long getValue()
public Object clone()
Variable
clone
in interface Variable
clone
in class AbstractVariable
Variable
with the same value.public final int toInt()
AbstractVariable
toInt
in interface Variable
toInt
in class AbstractVariable
public final long toLong()
AbstractVariable
toLong
in interface AssignableFromLong
toLong
in interface Variable
toLong
in class AbstractVariable
public OID toSubIndex(boolean impliedLength)
AbstractVariable
Variable
to a (sub-)index
value.toSubIndex
in interface Variable
toSubIndex
in class AbstractVariable
impliedLength
- specifies if the sub-index has an implied length. This parameter applies
to variable length variables only (e.g. OctetString
and
OID
). For other variables it has no effect.public void fromSubIndex(OID subIndex, boolean impliedLength)
AbstractVariable
Variable
from the supplied (sub-)index.fromSubIndex
in interface Variable
fromSubIndex
in class AbstractVariable
subIndex
- the sub-index OID.impliedLength
- specifies if the sub-index has an implied length. This parameter applies
to variable length variables only (e.g. OctetString
and
OID
). For other variables it has no effect.Copyright © 2018 SNMP4J.org. All rights reserved.