public class Counter32 extends UnsignedInteger32
Counter32
class allows all the functionality of unsigned
integers but is recognized as a distinct SMI type, which is used for
monotonically increasing values that wrap around at 2^32-1 (4294967295).Modifier and Type | Field and Description |
---|---|
static long |
MAX_COUNTER32_VALUE |
value
SMISYNTAXES_PROPERTIES
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this variable.
|
void |
decodeBER(BERInputStream inputStream)
Decodes a
Variable from an BERInputStream . |
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 |
getSyntax()
Gets the ASN.1 syntax identifier value of this SNMP variable.
|
void |
increment()
Increment the value of the counter by one.
|
long |
increment(long increment)
Increment the value by more than one in one step.
|
OID |
toSubIndex(boolean impliedLength)
Converts the value of this
Variable to a (sub-)index
value. |
compareTo, getBERLength, getValue, hashCode, setValue, setValue, toInt, toLong, toString
createFromBER, createFromSyntax, equal, getBERPayloadLength, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isException
public static final long MAX_COUNTER32_VALUE
public boolean equals(Object o)
equals
in interface Variable
equals
in class UnsignedInteger32
public int getSyntax()
AbstractVariable
getSyntax
in interface Variable
getSyntax
in class UnsignedInteger32
public void encodeBER(OutputStream outputStream) throws IOException
AbstractVariable
Variable
to an OutputStream
.encodeBER
in interface BERSerializable
encodeBER
in class UnsignedInteger32
outputStream
- an OutputStream
.IOException
- if an error occurs while writing to the stream.public void decodeBER(BERInputStream inputStream) throws IOException
AbstractVariable
Variable
from an BERInputStream
.decodeBER
in interface BERSerializable
decodeBER
in class UnsignedInteger32
inputStream
- an BERInputStream
containing a BER encoded byte stream.IOException
- if the stream could not be decoded by using BER rules.public Object clone()
Variable
clone
in interface Variable
clone
in class UnsignedInteger32
Variable
with the same value.public void increment()
public long increment(long increment)
increment
- an increment value greater than zero.public OID toSubIndex(boolean impliedLength)
AbstractVariable
Variable
to a (sub-)index
value.toSubIndex
in interface Variable
toSubIndex
in class UnsignedInteger32
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 UnsignedInteger32
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.