public class Counter64 extends AbstractVariable implements AssignableFromLong, AssignableFromString
Counter64 class represents a 64bit unsigned integer type.
It is used for monotonically increasing values that wrap around at
2^64-1 (18446744073709551615).
The unsigned 64bit value is represented by a signed 64bit long value
internally.SMISYNTAXES_PROPERTIES| 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 |
increment()
Increment the value of the counter by one.
|
long |
increment(long increment)
Increment the value by more than one in one step.
|
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, isExceptionpublic void encodeBER(OutputStream outputStream) throws IOException
AbstractVariableVariable to an OutputStream.encodeBER in interface BERSerializableencodeBER in class AbstractVariableoutputStream - an OutputStream.IOException - if an error occurs while writing to the stream.public void decodeBER(BERInputStream inputStream) throws IOException
AbstractVariableVariable from an InputStream.decodeBER in interface BERSerializabledecodeBER in class AbstractVariableinputStream - an InputStream containing a BER encoded byte stream.IOException - if the stream could not be decoded by using BER rules.public int getSyntax()
AbstractVariablegetSyntax in interface VariablegetSyntax in class AbstractVariablepublic int hashCode()
hashCode in interface VariablehashCode in class AbstractVariablepublic int getBERLength()
AbstractVariableVariable in bytes when encoded
according to the Basic Encoding Rules (BER).getBERLength in interface BERSerializablegetBERLength in class AbstractVariablepublic boolean equals(Object o)
equals in interface Variableequals in class AbstractVariablepublic int compareTo(Variable o)
compareTo in interface Comparable<Variable>compareTo in interface VariablecompareTo in class AbstractVariablepublic String toString()
AbstractVariabletoString in interface VariabletoString in class AbstractVariablepublic void setValue(String value)
setValue in interface AssignableFromStringpublic void setValue(long value)
setValue in interface AssignableFromLongpublic long getValue()
public Object clone()
Variableclone in interface Variableclone in class AbstractVariableVariable with the same value.public void increment()
public long increment(long increment)
increment - an increment value greater than zero.public final int toInt()
AbstractVariabletoInt in interface VariabletoInt in class AbstractVariablepublic final long toLong()
AbstractVariabletoLong in interface AssignableFromLongtoLong in interface VariabletoLong in class AbstractVariablepublic OID toSubIndex(boolean impliedLength)
AbstractVariableVariable to a (sub-)index
value.toSubIndex in interface VariabletoSubIndex in class AbstractVariableimpliedLength - 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)
AbstractVariableVariable from the supplied (sub-)index.fromSubIndex in interface VariablefromSubIndex in class AbstractVariablesubIndex - 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 © 2016 SNMP4J.org. All Rights Reserved.