rrdService.util
Class Time

java.lang.Object
  |
  +--rrdService.util.Time
All Implemented Interfaces:
java.io.Serializable

public class Time
extends java.lang.Object
implements java.io.Serializable

The class Time allows to manage rrdTool time format

Version:
1.0 date : 15/07/2001
Author:
Pellier Damien
See Also:
Time, Calendar, Serialized Form

Field Summary
private  java.util.Calendar calendar
          Calendar representing the time
private  long lastTime
          Last Time
 
Constructor Summary
Time()
          Constructs a Time with the time ritgth now for client
Time(long time)
          Constructs a Time with the specific time for client
Time(long time, java.util.TimeZone timeZone)
          Constructs a Time with the specific time for service
Time(java.util.TimeZone timeZone)
          Constructs a Time with the time ritgth now for service
 
Method Summary
 Time getLastTime()
          lastTime returns the UTC time in second since the creation or the refresh of this time
 long getMillisecond()
          Returns the UTC time in ms since 1st January 1970
 Time getNowTime()
          getNowTime returns the UTC time rigth now in second
 long getTime()
          getTime returns the UTC time in second since 1st January 1970
 Time refresh()
          Refresh done Time point to the current time
 Time synchronize(long sec)
          synchronize resynchronized the time
 java.lang.String toString()
          toString returns a string representation of time
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

calendar

private java.util.Calendar calendar
Calendar representing the time

lastTime

private long lastTime
Last Time
Constructor Detail

Time

public Time()
Constructs a Time with the time ritgth now for client

Time

public Time(long time)
Constructs a Time with the specific time for client
Parameters:
time - a long representing the time since 1st January 1970

Time

public Time(long time,
            java.util.TimeZone timeZone)
Constructs a Time with the specific time for service
Parameters:
time - a long representing the time since 1st January 1970
timeZone - the time zone of reference

Time

public Time(java.util.TimeZone timeZone)
Constructs a Time with the time ritgth now for service
Parameters:
timeZone - the time zone of reference
Method Detail

getLastTime

public Time getLastTime()
lastTime returns the UTC time in second since the creation or the refresh of this time

getMillisecond

public long getMillisecond()
Returns the UTC time in ms since 1st January 1970

getNowTime

public Time getNowTime()
getNowTime returns the UTC time rigth now in second

getTime

public long getTime()
getTime returns the UTC time in second since 1st January 1970

refresh

public Time refresh()
Refresh done Time point to the current time

synchronize

public Time synchronize(long sec)
synchronize resynchronized the time
Parameters:
sec - the number of second to resychronize

toString

public java.lang.String toString()
toString returns a string representation of time
Overrides:
toString in class java.lang.Object

Copyright 1885-2001 FIRMENICH SA, Geneva

Submit a bug or feature
Copyright 1885-2001 FIRMENICH SA, Geneva,
All Rights Reserved.