com.adventnet.snmp.snmp2
Class SnmpTimeticks

java.lang.Object
  extended by com.adventnet.snmp.snmp2.SnmpVar
      extended by com.adventnet.snmp.snmp2.SnmpUnsignedInt
          extended by com.adventnet.snmp.snmp2.SnmpTimeticks
All Implemented Interfaces:
java.io.Serializable

public class SnmpTimeticks
extends SnmpUnsignedInt

Class of SNMP Timeticks Variable - Sub-class of SnmpVar. A timeticks value has the unit of hundredth of a second. This class can be used to create an SnmpVar object of type SnmpTimeticks. It also has methods to retrieve the value in different forms(eg. long String, byte).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.adventnet.snmp.snmp2.SnmpUnsignedInt
byteValue, value
 
Fields inherited from class com.adventnet.snmp.snmp2.SnmpVar
Type, varbindErrorVal
 
Constructor Summary
SnmpTimeticks(long s)
          Constructs a new SnmpTimeticks object by taking a long type as its argument
 
Method Summary
(package private)  int encode(byte[] buff, int space)
          ASN encoder
(package private)  java.lang.String fmt(int i)
          get two digit values for HH:MM:SS
 java.lang.String toShortString()
          To convert the value of this SnmpTimeticks object to a printable string with Nd HH:MM:SS
 java.lang.String toString()
          To convert the value of this SnmpTimeticks object to a printable string with # days, # hours, etc.
 java.lang.String toTagString()
          To convert the value of this SnmpTimeticks object to a printable string where the type is tagged before the value with a tag TimeTicks: .
 
Methods inherited from class com.adventnet.snmp.snmp2.SnmpUnsignedInt
equals, getNumericValueAsString, getVarObject, longValue, toBytes, toValue
 
Methods inherited from class com.adventnet.snmp.snmp2.SnmpVar
createVariable, getError, getType, getTypeString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpTimeticks

public SnmpTimeticks(long s)
Constructs a new SnmpTimeticks object by taking a long type as its argument

Parameters:
s - The Timeticks as long type for creating a new SnmpTimeticks object. The valid value ranges from 0 to 4294967295(both inclusive).
Method Detail

toString

public java.lang.String toString()
To convert the value of this SnmpTimeticks object to a printable string with # days, # hours, etc.

Overrides:
toString in class SnmpUnsignedInt
Returns:
the value of this SnmpTimeticks object to a printable string with # days, # hours, etc.

toShortString

public java.lang.String toShortString()
To convert the value of this SnmpTimeticks object to a printable string with Nd HH:MM:SS

Returns:
the value of this SnmpTimeticks object to a printable string with Nd HH:MM:SS

toTagString

public java.lang.String toTagString()
To convert the value of this SnmpTimeticks object to a printable string where the type is tagged before the value with a tag TimeTicks: .

Overrides:
toTagString in class SnmpUnsignedInt
Returns:
the value of this SnmpTimeticks object to a printable string where the type is tagged before the value with a tag TimeTicks: .

encode

int encode(byte[] buff,
           int space)
     throws java.lang.ArrayIndexOutOfBoundsException
ASN encoder

Overrides:
encode in class SnmpUnsignedInt
Parameters:
buff - The buffer into which the value is to be encoded
space - The number of free bytes in the buffer
Returns:
The number of free bytes in the buffer
Throws:
java.lang.ArrayIndexOutOfBoundsException - When there is insufficient space in buffer

fmt

java.lang.String fmt(int i)
get two digit values for HH:MM:SS

Returns:
The two digit String for HH:MM:SS