edu.hkust.afchecker.data
Class Time

java.lang.Object
  extended by edu.hkust.afchecker.data.Time

public class Time
extends java.lang.Object

Author: Andrew
File history: Created on July 22, 2011. Last update on Sept. 16, 2012
Description: Time in format hh:mm.


Constructor Summary
Time(int h, int m)
          constructor
 
Method Summary
 int convertToMinuteOffset()
          convert the time to minutes (with respect to 00:00, the precision level is 1 minute)
static boolean earlierThan(Time t1, Time t2)
          check the temporal relationship between two time points
static boolean laterThan(Time t1, Time t2)
          check the temporal relationship between two time points
static boolean timeEqual(Time t1, Time t2)
          check whether two time points are equal
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Time

public Time(int h,
            int m)
constructor

Parameters:
h - hour
m - minute
Method Detail

timeEqual

public static boolean timeEqual(Time t1,
                                Time t2)
check whether two time points are equal

Parameters:
t1 -
t2 -
Returns:
return true if t1 and t2 refer to the same time point

earlierThan

public static boolean earlierThan(Time t1,
                                  Time t2)
check the temporal relationship between two time points

Parameters:
t1 -
t2 -
Returns:
true if time t1 is earlier than t2

laterThan

public static boolean laterThan(Time t1,
                                Time t2)
check the temporal relationship between two time points

Parameters:
t1 -
t2 -
Returns:
true if time t1 is later than t2

convertToMinuteOffset

public int convertToMinuteOffset()
convert the time to minutes (with respect to 00:00, the precision level is 1 minute)

Returns:
the minute offset