jd.util
Class Time

java.lang.Object
  extended byjd.util.Time
All Implemented Interfaces:
Cloneable

public class Time
extends Object
implements Cloneable

Time represents a time.


Constructor Summary
Time()
          Create a Time object for the current system time.
Time(Calendar cal)
          Create a time from a Calendar.
Time(int hour, int minute, int second)
          Create a new Time.
Time(long time)
          Create a new Time.
Time(Time time)
          Create a Time from the given Time.
 
Method Summary
 Object clone()
          Return a copy of this Time.
 boolean equals(Object time)
          Test if the given Time object represents the same time.
 int getHour()
          Return the hour.
 int getMinute()
          Return the minute.
 int getSecond()
          Return the second.
 boolean isAfter(Time t)
          Test if this time is after the given time.
 boolean isBefore(Time t)
          Test if this time is before the given time.
static boolean isValidTime(int hour, int minute, int second)
          Test if the given values represent a valid time.
static Time now()
          Return the current system time.
 int toInteger()
          Return an integer representation of this date.
 String toString()
          Return a string representation of this date in the form hh:mm:ss.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Time

public Time()
Create a Time object for the current system time.


Time

public Time(long time)
Create a new Time.

Parameters:
time - the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

Time

public Time(Calendar cal)
Create a time from a Calendar.


Time

public Time(int hour,
            int minute,
            int second)
Create a new Time.

Parameters:
hour - a value between 0 and 23.
minute - a value between 0 and 59.
second - a value between 0 and 59.

Time

public Time(Time time)
Create a Time from the given Time.

Method Detail

now

public static Time now()
Return the current system time.


getSecond

public int getSecond()
Return the second.

Returns:
a value between 0 and 59.

getMinute

public int getMinute()
Return the minute.

Returns:
a value between 0 and 59.

getHour

public int getHour()
Return the hour.

Returns:
a value between 0 and 23.

equals

public boolean equals(Object time)
Test if the given Time object represents the same time.


isBefore

public boolean isBefore(Time t)
Test if this time is before the given time.


isAfter

public boolean isAfter(Time t)
Test if this time is after the given time.


isValidTime

public static boolean isValidTime(int hour,
                                  int minute,
                                  int second)
Test if the given values represent a valid time.


clone

public Object clone()
Return a copy of this Time.


toString

public String toString()
Return a string representation of this date in the form hh:mm:ss. This serves for debug purpose only and does not address any locale issues.


toInteger

public int toInteger()
Return an integer representation of this date.