HOME

com.ireasoning.protocol.snmp
Class SnmpTimeTicks

java.lang.Object
  extended bycom.ireasoning.protocol.snmp.SnmpUInt
      extended bycom.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

Field Summary
 
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, serialVersionUID, 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 an 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 an 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

Specified by:
getType in interface SnmpDataType
Overrides:
getType in class SnmpUInt

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"

Specified by:
getTypeString in interface SnmpDataType
Overrides:
getTypeString in class SnmpUInt

copy

public SnmpDataType copy()
Return a deep copy of this object.

Specified by:
copy in interface SnmpDataType
Overrides:
copy in class SnmpUInt

encode

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

Specified by:
encode in interface SnmpDataType
Overrides:
encode in class SnmpUInt
Throws:
SnmpEncodingException

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.