public class TimeTicks extends UnsignedInteger32
TimeTicks
class represents the time in 1/100 seconds since some epoch (which should be have been
defined in the corresponding MIB specification).value
SMISYNTAXES_PROPERTIES
Constructor and Description |
---|
TimeTicks() |
TimeTicks(long value) |
TimeTicks(TimeTicks other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this variable.
|
void |
decodeBER(BERInputStream inputStream)
Decodes a
Variable from an BERInputStream . |
void |
encodeBER(OutputStream os)
Encodes a
Variable to an OutputStream . |
void |
fromMilliseconds(long millis)
Sets the timeticks value by milliseconds.
|
int |
getSyntax()
Gets the ASN.1 syntax identifier value of this SNMP variable.
|
void |
setValue(String value)
Sets the value of this TimeTicks instance from a string.
|
long |
toMilliseconds()
Returns the timeticks value as milliseconds (instead 1/100 seconds).
|
String |
toString()
Returns string with the value of this
TimeTicks object as "[days,]hh:mm:ss.hh". |
String |
toString(String pattern)
Formats the content of this
TimeTicks object according to a supplied MessageFormat
pattern. |
compareTo, equals, fromSubIndex, getBERLength, getBERLengthFromValue, getValue, hashCode, setValue, toInt, toLong, toSubIndex
createFromBER, createFromSyntax, equal, getBERPayloadLength, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isException
public TimeTicks()
public TimeTicks(TimeTicks other)
other
- a TimeTicks instance.public TimeTicks(long value)
public Object clone()
Variable
clone
in interface Variable
clone
in class UnsignedInteger32
Variable
with the same value.public int getSyntax()
AbstractVariable
getSyntax
in interface Variable
getSyntax
in class UnsignedInteger32
public void encodeBER(OutputStream os) throws IOException
AbstractVariable
Variable
to an OutputStream
.encodeBER
in interface BERSerializable
encodeBER
in class UnsignedInteger32
os
- 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 String toString()
TimeTicks
object as "[days,]hh:mm:ss.hh".toString
in interface Variable
toString
in class UnsignedInteger32
String
representation of this object.public final void setValue(String value)
setValue
in interface AssignableFromString
setValue
in class UnsignedInteger32
value
- a string representation of this value, which is
(a) is either an unsigned number or
(b) matches the format FORMAT_PATTERN.public String toString(String pattern)
TimeTicks
object according to a supplied MessageFormat
pattern.pattern
- a MessageFormat
pattern that takes up to five parameters which are: days, hours, minutes,
seconds, and 1/100 seconds.public long toMilliseconds()
getValue()*10
.public void fromMilliseconds(long millis)
millis
- sets the value as setValue(millis/10)
.Copyright © 2020 SNMP4J.org. All rights reserved.