FileDocCategorySizeDatePackage
Timestamp.javaAPI DocJava SE 5 API4027Fri Aug 26 14:55:04 BST 2005com.sun.jmx.snmp

Timestamp

public class Timestamp extends Object implements Serializable
This class is used by the {@link com.sun.jmx.snmp.SnmpVarBindList SnmpVarBindList} object. An SnmpVarBindList time stamp object represents the time stamp when the list was updated with the response variables.

This API is a Sun Microsystems internal API and is subject to change without notice.

Fields Summary
private long
sysUpTime
The time (in hundreds of a second) since the network management portion of the system was last re-initialized.
private long
crtime
A long representing the current date.
private Date
dateCache
A Date object representing the current date.
private SnmpTimeticks
uptimeCache
The SnmpTimeticks object corresponding to the TimeStamp object.
Constructors Summary
public Timestamp()
The default constructor. Sysuptime is 0. This simply indicates when this object was created.

    
    
    // CONSTRUCTORS
    //-------------
    
                         
      
        crtime = System.currentTimeMillis() ;
    
public Timestamp(long uptime, long when)
Creates a TimeStamp object using the user parameters.

param
uptime The time (in hundredths of a second) since the network management portion of the system was last re-initialized.
param
when The current time.

        sysUpTime = uptime ;
        crtime = when ;
    
public Timestamp(long uptime)
Creates a TimeStamp object using the user parameters.

param
uptime The time (in hundredths of a second) since the network management portion of the system was last re-initialized.

        sysUpTime = uptime ;
        crtime = System.currentTimeMillis() ;
    
Methods Summary
public final synchronized java.util.DategetDate()
Gets the current date.

return
A Date object representing the current date.

        if (dateCache == null)
            dateCache = new Date(crtime) ;
        return dateCache ;
    
public final longgetDateTime()
Gets the current date.

return
A long representing the current date.

        return crtime ;
    
public final longgetSysUpTime()
Gets the time (in hundredths of a second) since the network management portion of the system was last re-initialized.

return
The sysUpTime.

        return sysUpTime ;
    
public final synchronized SnmpTimeticksgetTimeTicks()
Gets the SnmpTimeticks object corresponding to the TimeStamp object.

return
The SnmpTimeticks object.

        if (uptimeCache == null)
            uptimeCache = new SnmpTimeticks((int)sysUpTime) ;
        return uptimeCache ;
    
public final java.lang.StringtoString()
Returns a String representation of the TimeStamp object.

return
A String representation of the TimeStamp object.

        StringBuffer buf = new StringBuffer() ;
        buf.append("{SysUpTime = " + SnmpTimeticks.printTimeTicks(sysUpTime)) ;
        buf.append("} {Timestamp = " + getDate().toString() + "}") ;
        return buf.toString() ;