cs.arizona.tau.xml.temporalconstraint
Class Applicability

java.lang.Object
  extended by cs.arizona.tau.xml.temporalconstraint.Applicability

public class Applicability
extends java.lang.Object

Applicability as a time period

Author:
ruizhang

Constructor Summary
Applicability(java.lang.String start_time, java.lang.String end_time)
          Constructing the applicability instance
 
Method Summary
static int CompareTime(java.lang.String t1, java.lang.String t2)
          Comparing two time periods and determining the order
 java.lang.String GetEndTime()
           
static java.lang.String GetPeriodBound(java.lang.String begin, int gap)
          Given a start time stamp, computing the end time stamp according to the length of the period
 java.lang.String GetStartTime()
           
 boolean IsIntersect(java.lang.String st, java.lang.String et)
          Checking if the period of this applicability intersects with another one.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Applicability

public Applicability(java.lang.String start_time,
                     java.lang.String end_time)
Constructing the applicability instance

Parameters:
start_time - starting time
end_time - ending time
Method Detail

GetStartTime

public java.lang.String GetStartTime()
Returns:
the start time of the applicability

GetEndTime

public java.lang.String GetEndTime()
Returns:
the end time of the applicability

IsIntersect

public boolean IsIntersect(java.lang.String st,
                           java.lang.String et)
Checking if the period of this applicability intersects with another one.

Parameters:
st - start time
et - end time
Returns:
TRUE if intersects, FALSE otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

CompareTime

public static int CompareTime(java.lang.String t1,
                              java.lang.String t2)
Comparing two time periods and determining the order

Parameters:
t1 - Time period 1
t2 - Time period 2
Returns:
negative if t1 < t2; positive if t1 > t2; 0 otherwise

GetPeriodBound

public static java.lang.String GetPeriodBound(java.lang.String begin,
                                              int gap)
Given a start time stamp, computing the end time stamp according to the length of the period

Parameters:
begin - start time stamp
gap - length of the period (number of days)
Returns:
the end time stamp