org.opengts.db
Class WorkHours

java.lang.Object
  extended by org.opengts.db.WorkHours

public class WorkHours
extends java.lang.Object


Nested Class Summary
static class WorkHours.Day
          Day
 
Constructor Summary
WorkHours(RTConfig.PropertyGetter dayRTP)
          Constructor
WorkHours(RTConfig.PropertyGetter dayRTP, java.lang.String keyPrefix)
          Constructor
WorkHours(java.lang.String keyPrefix)
          Constructor
WorkHours(WorkHours.Day[] day)
          Constructor
 
Method Summary
 double countWorkHours(DateTime startDT, DateTime stopDT, java.util.TimeZone tz)
          Accumulate all work-hour time between the specified dates
 WorkHours.Day getDay(DateTime dateTime)
          Return the requested Day
 WorkHours.Day getDay(DateTime dateTime, java.util.TimeZone tz)
          Return the requested Day
 WorkHours.Day getDay(int dow)
          Return the requested Day
 WorkHours.Day getDay(long timestamp, java.util.TimeZone tz)
          Return the requested Day
 boolean isMatch(DateTime dateTime)
          True if the specified DateTime is within the current 'WorkingHours'
 boolean isMatch(DateTime dateTime, java.util.TimeZone tz)
          True if the specified DateTime is within the current 'WorkingHours'
 boolean isMatch(long timestamp, java.util.TimeZone tz)
          True if the specified DateTime is within the current 'WorkingHours'
static void main(java.lang.String[] argv)
           
 java.lang.String toString()
          Returns a String repreentation of this instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkHours

public WorkHours(WorkHours.Day[] day)
Constructor


WorkHours

public WorkHours(java.lang.String keyPrefix)
Constructor


WorkHours

public WorkHours(RTConfig.PropertyGetter dayRTP)
Constructor


WorkHours

public WorkHours(RTConfig.PropertyGetter dayRTP,
                 java.lang.String keyPrefix)
Constructor

Method Detail

getDay

public WorkHours.Day getDay(int dow)
Return the requested Day


getDay

public WorkHours.Day getDay(DateTime dateTime)
Return the requested Day


getDay

public WorkHours.Day getDay(DateTime dateTime,
                            java.util.TimeZone tz)
Return the requested Day


getDay

public WorkHours.Day getDay(long timestamp,
                            java.util.TimeZone tz)
Return the requested Day


isMatch

public boolean isMatch(DateTime dateTime)
True if the specified DateTime is within the current 'WorkingHours'


isMatch

public boolean isMatch(DateTime dateTime,
                       java.util.TimeZone tz)
True if the specified DateTime is within the current 'WorkingHours'


isMatch

public boolean isMatch(long timestamp,
                       java.util.TimeZone tz)
True if the specified DateTime is within the current 'WorkingHours'


countWorkHours

public double countWorkHours(DateTime startDT,
                             DateTime stopDT,
                             java.util.TimeZone tz)
Accumulate all work-hour time between the specified dates


toString

public java.lang.String toString()
Returns a String repreentation of this instance

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] argv)