org.jbpm.cal
Class BusinessCalendar

java.lang.Object
  extended by org.jbpm.cal.BusinessCalendar
All Implemented Interfaces:
java.io.Serializable

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

a calendar that knows about business hours.

See Also:
Serialized Form

Field Summary
protected  long businessDayInMillis
           
protected  long businessMonthInMillis
           
protected  long businessWeekInMillis
           
protected  long businessYearInMillis
           
protected  long dayInMillis
           
protected  Day[] days
          array that contains the weekdays in the index as specified by Calendar.SUNDAY (=1), Calendar.MONDAY (=2),...
protected  Holiday[] holidays
           
protected  long hourInMillis
           
protected  long minuteInMillis
           
protected  long monthInMillis
           
protected  long oid
           
protected  long secondInMillis
           
protected  java.util.TimeZone timeZone
           
protected  int version
           
protected  long weekInMillis
           
protected  long yearInMillis
           
 
Constructor Summary
BusinessCalendar()
          constructor for persistence and creating an empty business calendar
 
Method Summary
 java.util.Date add(java.util.Date date, Duration duration)
           
 long convertToMillis(Duration duration)
           
 java.util.Calendar createCalendar()
           
protected  Day findDay(java.util.Date date)
           
protected  DayPart findDayPart(java.util.Date date)
           
protected  DayPart findNextDayPart(java.util.Date date)
           
protected  java.util.Date findStartOfNextDay(java.util.Date date)
           
 long getBusinessDayInMillis()
           
 long getBusinessMonthInMillis()
           
 long getBusinessWeekInMillis()
           
 long getBusinessYearInMillis()
           
 long getDayInMillis()
           
 Day[] getDays()
           
 Holiday[] getHolidays()
           
 long getHourInMillis()
           
static BusinessCalendar getInstance()
           
 long getMinuteInMillis()
           
 long getMonthInMillis()
           
 long getSecondInMillis()
           
 java.util.TimeZone getTimeZone()
           
 long getWeekInMillis()
           
 long getYearInMillis()
           
 boolean isHoliday(java.util.Date date)
           
 boolean isInBusinessHours(java.util.Date date)
           
 void setBusinessDayInMillis(long businessDayInMillis)
           
 void setBusinessMonthInMillis(long businessMonthInMillis)
           
 void setBusinessWeekInMillis(long businessWeekInMillis)
           
 void setBusinessYearInMillis(long businessYearInMillis)
           
 void setDayInMillis(long dayInMillis)
           
 void setDays(Day[] days)
           
 void setHolidays(Holiday[] holidays)
           
 void setHourInMillis(long hourInMillis)
           
 void setMinuteInMillis(long minuteInMillis)
           
 void setMonthInMillis(long monthInMillis)
           
 void setSecondInMillis(long secondInMillis)
           
 void setTimeZone(java.util.TimeZone timeZone)
           
 void setWeekInMillis(long weekInMillis)
           
 void setYearInMillis(long yearInMillis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oid

protected long oid

version

protected int version

timeZone

protected java.util.TimeZone timeZone

days

protected Day[] days
array that contains the weekdays in the index as specified by Calendar.SUNDAY (=1), Calendar.MONDAY (=2),... Calendar.SATURDAY (=7).


holidays

protected Holiday[] holidays

secondInMillis

protected long secondInMillis

minuteInMillis

protected long minuteInMillis

hourInMillis

protected long hourInMillis

dayInMillis

protected long dayInMillis

weekInMillis

protected long weekInMillis

monthInMillis

protected long monthInMillis

yearInMillis

protected long yearInMillis

businessDayInMillis

protected long businessDayInMillis

businessWeekInMillis

protected long businessWeekInMillis

businessMonthInMillis

protected long businessMonthInMillis

businessYearInMillis

protected long businessYearInMillis
Constructor Detail

BusinessCalendar

public BusinessCalendar()
constructor for persistence and creating an empty business calendar

Method Detail

getInstance

public static BusinessCalendar getInstance()

add

public java.util.Date add(java.util.Date date,
                          Duration duration)

convertToMillis

public long convertToMillis(Duration duration)

isInBusinessHours

public boolean isInBusinessHours(java.util.Date date)

isHoliday

public boolean isHoliday(java.util.Date date)

findStartOfNextDay

protected java.util.Date findStartOfNextDay(java.util.Date date)

createCalendar

public java.util.Calendar createCalendar()

findDay

protected Day findDay(java.util.Date date)

findDayPart

protected DayPart findDayPart(java.util.Date date)

findNextDayPart

protected DayPart findNextDayPart(java.util.Date date)

getBusinessDayInMillis

public long getBusinessDayInMillis()

setBusinessDayInMillis

public void setBusinessDayInMillis(long businessDayInMillis)

getBusinessMonthInMillis

public long getBusinessMonthInMillis()

setBusinessMonthInMillis

public void setBusinessMonthInMillis(long businessMonthInMillis)

getBusinessWeekInMillis

public long getBusinessWeekInMillis()

setBusinessWeekInMillis

public void setBusinessWeekInMillis(long businessWeekInMillis)

getBusinessYearInMillis

public long getBusinessYearInMillis()

setBusinessYearInMillis

public void setBusinessYearInMillis(long businessYearInMillis)

getDayInMillis

public long getDayInMillis()

setDayInMillis

public void setDayInMillis(long dayInMillis)

getDays

public Day[] getDays()

setDays

public void setDays(Day[] days)

getHolidays

public Holiday[] getHolidays()

setHolidays

public void setHolidays(Holiday[] holidays)

getHourInMillis

public long getHourInMillis()

setHourInMillis

public void setHourInMillis(long hourInMillis)

getMinuteInMillis

public long getMinuteInMillis()

setMinuteInMillis

public void setMinuteInMillis(long minuteInMillis)

getMonthInMillis

public long getMonthInMillis()

setMonthInMillis

public void setMonthInMillis(long monthInMillis)

getSecondInMillis

public long getSecondInMillis()

setSecondInMillis

public void setSecondInMillis(long secondInMillis)

getTimeZone

public java.util.TimeZone getTimeZone()

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)

getWeekInMillis

public long getWeekInMillis()

setWeekInMillis

public void setWeekInMillis(long weekInMillis)

getYearInMillis

public long getYearInMillis()

setYearInMillis

public void setYearInMillis(long yearInMillis)