|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface defines the concept of business calendar. A business calendar tells if one day is a working day or not and several other things. It is a utility class.
| Method Summary | |
int |
daysBetween(Date start,
Date end)
Calculates and returns the number of days between two dates. |
double |
daysBetweenAsPercentAtYear(Date start,
Date end)
Returns the number of days between start and end dates as
percent at year. |
int |
daysOfWeekBetween(int dayOfWeek,
Date start,
Date end)
Calculates and returns the number of a certain day of week between two dates. |
String |
getName()
Returns the name of this business calendar |
boolean |
isHoliday(Date date)
Returns true if the specified date calendar is not working day. |
boolean |
isWorkingDay(Date date)
Returns true if the specified date calendar is a working day. |
Date |
nextHoliday(Date date)
Returns the next holiday day after date date. |
int |
nextPaymentDate(Date[] payments,
Date date)
Returns the index of the next payment date related to date. |
Date |
nextWorkingDay(Date date)
Returns the next working day after date date. |
int |
previousPaymentDate(Date[] payments,
Date date)
Returns the index of the previous payment date related to date. |
int |
workingDaysBetween(Date start,
Date end)
Calculates and returns the number of working days between two dates. |
double |
yearsBetween(Date start,
Date end)
Returns the number of years between start and end dates.
|
| Method Detail |
public String getName()
public boolean isWorkingDay(Date date)
true if the specified date calendar is a working day.
date - the date to check
true if the specified date calendar is a working day,
false otherwisepublic boolean isHoliday(Date date)
true if the specified date calendar is not working day.
date - the date to check
true if the specified date calendar is not working day,
false otherwise
public int daysBetween(Date start,
Date end)
start date and end date are the same date then we have
0 days between start and end;start date and end date are consecutive dates then we have
1 days between start and end;
start - the start dateend - the end date
IllegalArgumentException - if end date
public int daysOfWeekBetween(int dayOfWeek,
Date start,
Date end)
start date and end date are the same date and this date's
day of week is the wanted one then 1 is returned;start and end dates too;
dayOfWeek - one of the Date.MONDAY,...,Date.SUNDAY valuesstart - the start dateend - the end date
IllegalArgumentException - if end date
or dayOfWeek is not a day of week
public int workingDaysBetween(Date start,
Date end)
start - the start dateend - the end date
IllegalArgumentException - if end date
or if one of the dates is not a working day
public double daysBetweenAsPercentAtYear(Date start,
Date end)
start and end dates as
percent at year. This percent is calculated using this formula:
daysBetween( start, end ) / SS is the sum of days of years between the start and end dates
including the years of start date and end date.
start - the start dateend - the end date
start and end dates as percent at year
IllegalArgumentException - if end date
public double yearsBetween(Date start,
Date end)
start and end dates.
This number is returned as a double value and it is calculated using
daysBetweenAsPercentAtYear(Date, Date) method:
daysBetweenAsPercentAtYear(start, end) / 100
start - the start dateend - the end date
start and end dates
IllegalArgumentException - if end datepublic Date nextWorkingDay(Date date)
date date.
date - the date used to calculate the next working day
date datepublic Date nextHoliday(Date date)
date date.
date - the date used to calculate the next holiday day
date date
public int previousPaymentDate(Date[] payments,
Date date)
date.
payments - the payment datesdate - the date we are interested in
date
IllegalArgumentException - if date is before the first payment datenextPaymentDate(Date[], Date)
public int nextPaymentDate(Date[] payments,
Date date)
date.
payments - the payment datesdate - the date we are interested in
date
IllegalArgumentException - if date is after the last payment datepreviousPaymentDate(Date[], Date)
|
WebCab Options and Futures Demo v2.5 (J2SE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||