|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Calendar
java.util.GregorianCalendar
org.sandev.TaskHeap.PlanCalculator.ElapsedTimeCalendar
An elapsed time accumulator that keeps track of what calendar day you are at as you add up work hours. This is initialized with the number of work hours in a day. Saturday and Sunday are skipped.
Holidays are handled as an array of Date objects that are passed into the secondary ctor.
| Field Summary | |
protected java.util.Date[] |
holidays
Additional days that should not be considered workdays. |
protected int |
hoursPerDay
The number of work hours per day. |
static long |
millisPerDay
The number of milliseconds in a day. |
protected int |
remainderHours
The additional hours that were not factored into a specific day. |
| Fields inherited from class java.util.GregorianCalendar |
AD, BC |
| Fields inherited from class java.util.Calendar |
AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET |
| Constructor Summary | |
ElapsedTimeCalendar(int hoursPerDay,
java.util.Date[] holidays)
Create a new instance with the given number of work hours per day and an array of holidays. |
|
| Method Summary | |
void |
addHours(int hours)
Add the given number of hours to the current target date. |
java.lang.String |
getDateString()
Returns a brief canonical date representation for use in reports. |
boolean |
isHoliday()
Return true if this is a holiday, false otherwise. |
void |
skipHolidays()
Skip past any holidays, including weekend days. |
| Methods inherited from class java.util.GregorianCalendar |
add, computeFields, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, hashCode, isLeapYear, roll, roll, setGregorianChange |
| Methods inherited from class java.util.Calendar |
after, before, clear, clear, clone, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, getTimeZone, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final long millisPerDay
protected int hoursPerDay
protected java.util.Date[] holidays
protected int remainderHours
| Constructor Detail |
public ElapsedTimeCalendar(int hoursPerDay,
java.util.Date[] holidays)
| Method Detail |
public void addHours(int hours)
public void skipHolidays()
public boolean isHoliday()
public java.lang.String getDateString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||