public class AnnualCalendar extends BaseCalendar implements Calendar, Serializable
This implementation of the Calendar excludes a set of days of the year. You may use it to exclude bank holidays which are on the same date every year.
Calendar,
BaseCalendar,
Serialized Form| Constructor and Description |
|---|
AnnualCalendar() |
AnnualCalendar(Calendar baseCalendar) |
AnnualCalendar(Calendar baseCalendar,
TimeZone timeZone) |
AnnualCalendar(TimeZone timeZone) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
ArrayList<Calendar> |
getDaysExcluded()
Get the array which defines the exclude-value of each day of month
|
long |
getNextIncludedTime(long timeStamp)
Determine the next time (in milliseconds) that is 'included' by the
Calendar after the given time.
|
boolean |
isDayExcluded(Calendar day)
Return true, if day is defined to be exluded.
|
boolean |
isTimeIncluded(long timeStamp)
Determine whether the given time (in milliseconds) is 'included' by the
Calendar.
|
void |
removeExcludedDay(Calendar day)
Remove the given day from the list of excluded days
|
void |
setDayExcluded(Calendar day,
boolean exclude)
Redefine a certain day to be excluded (true) or included (false).
|
void |
setDaysExcluded(ArrayList<Calendar> days)
Redefine the list of days excluded.
|
createJavaCalendar, createJavaCalendar, getBaseCalendar, getDescription, getEndOfDayJavaCalendar, getStartOfDayJavaCalendar, getTimeZone, setBaseCalendar, setDescription, setTimeZoneequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBaseCalendar, getDescription, setBaseCalendar, setDescriptionpublic AnnualCalendar()
public AnnualCalendar(Calendar baseCalendar)
public AnnualCalendar(TimeZone timeZone)
public Object clone()
clone in interface Calendarclone in class BaseCalendarpublic ArrayList<Calendar> getDaysExcluded()
Get the array which defines the exclude-value of each day of month
public boolean isDayExcluded(Calendar day)
Return true, if day is defined to be exluded.
public void setDaysExcluded(ArrayList<Calendar> days)
Redefine the list of days excluded. The ArrayList
should contain java.util.Calendar objects.
public void setDayExcluded(Calendar day, boolean exclude)
Redefine a certain day to be excluded (true) or included (false).
public void removeExcludedDay(Calendar day)
day - the day to excludepublic boolean isTimeIncluded(long timeStamp)
Determine whether the given time (in milliseconds) is 'included' by the Calendar.
Note that this Calendar is only has full-day precision.
isTimeIncluded in interface CalendarisTimeIncluded in class BaseCalendarCalendar.isTimeIncluded(long)public long getNextIncludedTime(long timeStamp)
Determine the next time (in milliseconds) that is 'included' by the Calendar after the given time. Return the original value if timeStamp is included. Return 0 if all days are excluded.
Note that this Calendar is only has full-day precision.
getNextIncludedTime in interface CalendargetNextIncludedTime in class BaseCalendarCalendar.getNextIncludedTime(long)Copyright 2001-2019, Terracotta, Inc.