HOME

com.ireasoning.protocol.snmp
Class SnmpTimeTicks

java.lang.Object
  |
  +--com.ireasoning.protocol.snmp.SnmpUInt
        |
        +--com.ireasoning.protocol.snmp.SnmpTimeTicks
All Implemented Interfaces:
Msg, Serializable, SnmpDataType

public class SnmpTimeTicks
extends SnmpUInt

This class represents Snmp TimeTicks type object. The TimeTicks type represents a non-negative integer which represents the time, modulo 2^32 (4294967296 decimal), in hundredths of a second between two epochs.

See Also:
Serialized Form

Fields inherited from class com.ireasoning.protocol.snmp.SnmpUInt
MAX_VALUE
 
Fields inherited from interface com.ireasoning.protocol.snmp.SnmpDataType
BITS, BITSTRING, COUNTER32, COUNTER64, END_OF_MIB_VIEW, END_OF_MIB_VIEW_OBJECT, GAUGE32, INTEGER, IPADDRESS, NO_SUCH_INSTANCE, NO_SUCH_INSTANCE_OBJECT, NO_SUCH_OBJECT, NO_SUCH_OBJECT_OBJECT, NULL, OCTETSTRING, OID, OPAQUE, PDU, SEQUENCE, SEQUENCEOF, TIMETICKS, UNSIGNED32, VARBIND
 
Fields inherited from interface com.ireasoning.protocol.Msg
ERROR_TYPE
 
Constructor Summary
SnmpTimeTicks()
          Default constructor
SnmpTimeTicks(long value)
          Constructs the object with passed value, in hundredths of a second
SnmpTimeTicks(SnmpTimeTicks timeticks)
          Makes a copy of passed timeticks object
SnmpTimeTicks(String value)
          Constructs a SnmpCounter32 object based on passed counter
 
Method Summary
 SnmpDataType copy()
          Return a deep copy of this object.
 int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
          For internal use
 String getTimeString()
          Returns human readable time string, such as "10 milliseconds", "10 hours 22 minute 31 seconds".
static String getTimeString(long time)
          Returns human readable time string, such as "10 milliseconds", "10 hours 22 minute 31 seconds".
 int getType()
          Returns SnmpDataType.TIMETICKS
 String getTypeString()
          Returns "TimeTicks"
 String toString()
           
 
Methods inherited from class com.ireasoning.protocol.snmp.SnmpUInt
equals, getValue, hashCode, setValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpTimeTicks

public SnmpTimeTicks()
Default constructor

SnmpTimeTicks

public SnmpTimeTicks(long value)
Constructs the object with passed value, in hundredths of a second

SnmpTimeTicks

public SnmpTimeTicks(String value)
Constructs a SnmpCounter32 object based on passed counter

SnmpTimeTicks

public SnmpTimeTicks(SnmpTimeTicks timeticks)
Makes a copy of passed timeticks object
Method Detail

getType

public int getType()
Returns SnmpDataType.TIMETICKS
Overrides:
getType in class SnmpUInt
Following copied from interface: com.ireasoning.protocol.snmp.SnmpDataType
Returns:
the object data type

toString

public String toString()
Overrides:
toString in class SnmpUInt

getTimeString

public String getTimeString()
Returns human readable time string, such as "10 milliseconds", "10 hours 22 minute 31 seconds".

getTimeString

public static String getTimeString(long time)
Returns human readable time string, such as "10 milliseconds", "10 hours 22 minute 31 seconds".
Parameters:
time - the time integer to be translated to human readable string

getTypeString

public String getTypeString()
Returns "TimeTicks"
Overrides:
getTypeString in class SnmpUInt

copy

public SnmpDataType copy()
Return a deep copy of this object.
Overrides:
copy in class SnmpUInt
Following copied from interface: com.ireasoning.protocol.snmp.SnmpDataType
Returns:
a deep copy of this object

encode

public int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
           throws SnmpEncodingException
Description copied from interface: SnmpDataType
For internal use
Overrides:
encode in class SnmpUInt

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.