Package org.snmp4j.smi
Class TimeTicks
java.lang.Object
org.snmp4j.smi.AbstractVariable
org.snmp4j.smi.UnsignedInteger32
org.snmp4j.smi.TimeTicks
- All Implemented Interfaces:
 Serializable,Cloneable,Comparable<Variable>,BERSerializable,AssignableFromLong,AssignableFromString,Variable
The 
TimeTicks class represents the time in 1/100 seconds since some epoch (which should be have been
 defined in the corresponding MIB specification).- Version:
 - 2.8.1
 - Author:
 - Frank Fock
 - See Also:
 
- 
Field Summary
Fields inherited from class org.snmp4j.smi.UnsignedInteger32
valueFields inherited from class org.snmp4j.smi.AbstractVariable
SMISYNTAXES_PROPERTIES - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this variable.voiddecodeBER(BERInputStream inputStream) Decodes aVariablefrom anBERInputStream.voidEncodes aVariableto anOutputStream.voidfromMilliseconds(long millis) Sets the timeticks value by milliseconds.intGets the ASN.1 syntax identifier value of this SNMP variable.final voidSets the value of this TimeTicks instance from a string.longReturns the timeticks value as milliseconds (instead 1/100 seconds).toString()Returns string with the value of thisTimeTicksobject as "[days,]hh:mm:ss.hh".Formats the content of thisTimeTicksobject according to a suppliedMessageFormatpattern.Methods inherited from class org.snmp4j.smi.UnsignedInteger32
compareTo, equals, fromSubIndex, getBERLength, getBERLengthFromValue, getValue, hashCode, setValue, toInt, toLong, toSubIndexMethods inherited from class org.snmp4j.smi.AbstractVariable
createFromBER, createFromSyntax, equal, getBERPayloadLength, getSyntaxFromString, getSyntaxString, getSyntaxString, isDynamic, isException 
- 
Constructor Details
- 
TimeTicks
public TimeTicks() - 
TimeTicks
Copy constructor.- Parameters:
 other- a TimeTicks instance.- Since:
 - 1.7
 
 - 
TimeTicks
public TimeTicks(long value)  
 - 
 - 
Method Details
- 
clone
Description copied from interface:VariableClones this variable. Cloning can be used by the SNMP4J API to better support concurrency by creating a clone for internal processing. The content of this object is independent to the content of the clone. Thus, changes to the clone will have no effect to this object.- Specified by:
 clonein interfaceVariable- Overrides:
 clonein classUnsignedInteger32- Returns:
 - a new instance of this 
Variablewith the same value. 
 - 
getSyntax
public int getSyntax()Description copied from class:AbstractVariableGets the ASN.1 syntax identifier value of this SNMP variable.- Specified by:
 getSyntaxin interfaceVariable- Overrides:
 getSyntaxin classUnsignedInteger32- Returns:
 - an integer value less than 128 for regular SMI objects and a value greater or equal than 128 for exception values like noSuchObject, noSuchInstance, and endOfMibView.
 
 - 
encodeBER
Description copied from class:AbstractVariableEncodes aVariableto anOutputStream.- Specified by:
 encodeBERin interfaceBERSerializable- Overrides:
 encodeBERin classUnsignedInteger32- Parameters:
 os- anOutputStream.- Throws:
 IOException- if an error occurs while writing to the stream.
 - 
decodeBER
Description copied from class:AbstractVariableDecodes aVariablefrom anBERInputStream.- Specified by:
 decodeBERin interfaceBERSerializable- Overrides:
 decodeBERin classUnsignedInteger32- Parameters:
 inputStream- anBERInputStreamcontaining a BER encoded byte stream.- Throws:
 IOException- if the stream could not be decoded by using BER rules.
 - 
toString
Returns string with the value of thisTimeTicksobject as "[days,]hh:mm:ss.hh".- Specified by:
 toStringin interfaceVariable- Overrides:
 toStringin classUnsignedInteger32- Returns:
 - a 
Stringrepresentation of this object. 
 - 
setValue
Sets the value of this TimeTicks instance from a string.- Specified by:
 setValuein interfaceAssignableFromString- Overrides:
 setValuein classUnsignedInteger32- Parameters:
 value- a string representation of this value, which is (a) is either an unsigned number or (b) matches the format FORMAT_PATTERN.- Since:
 - 2.1.2
 
 - 
toString
Formats the content of thisTimeTicksobject according to a suppliedMessageFormatpattern.- Parameters:
 pattern- aMessageFormatpattern that takes up to five parameters which are: days, hours, minutes, seconds, and 1/100 seconds.- Returns:
 - the formatted string representation.
 
 - 
toMilliseconds
public long toMilliseconds()Returns the timeticks value as milliseconds (instead 1/100 seconds).- Returns:
 getValue()*10.- Since:
 - 1.7
 
 - 
fromMilliseconds
public void fromMilliseconds(long millis) Sets the timeticks value by milliseconds.- Parameters:
 millis- sets the value assetValue(millis/10).- Since:
 - 1.7
 
 
 -