|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jaxfront.core.util.DateCalculator
public class DateCalculator
| Field Summary | |
|---|---|
static java.text.SimpleDateFormat |
DEFAULT_FORMAT
|
| Constructor Summary | |
|---|---|
DateCalculator()
|
|
| Method Summary | |
|---|---|
static java.util.Date |
getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek)
Use to find out what date is a certain number of days after a base date, not counting certain days. |
static java.util.Date |
getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek,
java.util.Date[] excludedDateList)
Use to find out what date is a certain number of days after a base date, not counting certain days. |
static java.util.Date |
getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek,
java.util.Hashtable excludedDates)
Use to find out what date is a certain number of days after a base date, not counting certain days. |
static java.util.Date |
getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek,
java.lang.String[] excludedDateList)
Use to find out what date is a certain number of days after a base date, not counting certain days. |
static boolean |
isExcludedDate(java.util.Calendar checkCal,
java.util.Hashtable excludedDays,
java.util.Hashtable excludedDates)
Tells you if the checkCal day/date is in one of the exclusion lists |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.text.SimpleDateFormat DEFAULT_FORMAT
| Constructor Detail |
|---|
public DateCalculator()
| Method Detail |
|---|
public static java.util.Date getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek)
daysAway - Number of non-excluded days from the baseDate
that the result date will bebaseDate - Date to start counting daysAway from.
If specify "null" defaults to todayexcludedDaysOfWeek - Array of constants from java.util.Calendar object
e.g. Calendar.SUNDAY, which are excluded from
counting towards daysAway for the result
DateBean#getEarliestNonExcludedDate(int, java.util.Date, int[], Hashtable)
public static java.util.Date getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek,
java.lang.String[] excludedDateList)
daysAway - Number of non-excluded days from the baseDate
that the result date will bebaseDate - Date to start counting daysAway from.
If specify "null" defaults to todayexcludedDaysOfWeek - Array of constants from java.util.Calendar object
e.g. Calendar.SUNDAY, which are excluded from
counting towards daysAway for the resultexcludedDateList - Array of date strings
(formatted as SimpleDateFormat.getDateInstance().format())
which represent specific dates which should be
excluded from the counting of days, such as holidays
DateBean#getEarliestNonExcludedDate(int, java.util.Date, int[], Hashtable)
public static java.util.Date getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek,
java.util.Date[] excludedDateList)
daysAway - Number of non-excluded days from the baseDate
that the result date will bebaseDate - Date to start counting daysAway from.
If specify "null" defaults to todayexcludedDaysOfWeek - Array of constants from java.util.Calendar object
e.g. Calendar.SUNDAY, which are excluded from
counting towards daysAway for the resultexcludedDateList - Array of date objects
which represent specific dates which should be
excluded from the counting of days, such as holidays
DateBean#getEarliestNonExcludedDate(int, java.util.Date, int[], Hashtable)
public static java.util.Date getEarliestNonExcludedDate(int daysAway,
java.util.Date baseDate,
int[] excludedDaysOfWeek,
java.util.Hashtable excludedDates)
Use to find out what date is a certain number of days after a base date, not counting certain days.
Primary example: Give me the date which is at least 3 business days from today.
Usage for example:
daysAway = 3
baseDate = today (i.e. new Date() )
excludedDaysOfWeek = array with values for Sat and Sun
(i.e. { Calendar.SATURDAY, Calendar.SUNDAY } )
excludedDates = Hashtable with elements whose keys are
java.util.Date objects equal to various
business holidays not to be counted towards progress
daysAway - Number of non-excluded days from the baseDate
that the result date will bebaseDate - Date to start counting daysAway from.
If specify "null," defaults to todayexcludedDaysOfWeek - Array of constants from java.util.Calendar object
e.g. Calendar.SUNDAY, which are excluded from
counting towards daysAway for the resultexcludedDates - Hashtable of java.util.Date objects, which represent
specific dates (12:00am midnight) which should
be excluded from counting towards the daysAway
public static boolean isExcludedDate(java.util.Calendar checkCal,
java.util.Hashtable excludedDays,
java.util.Hashtable excludedDates)
checkCal - Calendar objects representing the date to checkexcludedDays - Hashtable with Integer keys representing days of the
week which count as excluded. Integer keys
are constants from Calendar class, e.g. Calendar.SUNDAYexcludedDates - Hashtable with elements with java.util.Date objects
as keys which represent specific dates which
should be excluded. Dates should all be set
on 12am midnight for correct comparison.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||