public class MonthlyCalendar extends AbstractCalendar<MonthlyCalendar>
This implementation of the Calendar excludes a set of days of the month. You may use it to exclude every first day of each month for example. But you may define any day of a month.
ICalendar,
AbstractCalendar| Constructor and Description |
|---|
MonthlyCalendar() |
MonthlyCalendar(ICalendar baseCalendar) |
MonthlyCalendar(ICalendar baseCalendar,
TimeZone timeZone) |
MonthlyCalendar(MonthlyCalendar aOther) |
MonthlyCalendar(TimeZone timeZone) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areAllDaysExcluded()
Check if all days are excluded.
|
MonthlyCalendar |
getClone() |
boolean[] |
getDaysExcluded()
Get the array which defines the exclude-value of each day of month.
|
long |
getNextIncludedTime(long nTimeStamp)
Determine the next time (in milliseconds) that is 'included' by the
Calendar after the given time.
|
boolean |
isDayExcluded(int day)
Return true, if day is defined to be excluded.
|
boolean |
isTimeIncluded(long timeStamp)
Determine whether the given time (in milliseconds) is 'included' by the
Calendar.
|
void |
setDayExcluded(int day,
boolean exclude)
Redefine a certain day of the month to be excluded (true) or included
(false).
|
void |
setDaysExcluded(boolean[] days)
Redefine the array of days excluded.
|
createJavaCalendar, createJavaCalendar, getBaseCalendar, getDescription, getEndOfDayJavaCalendar, getStartOfDayJavaCalendar, getTimeZone, setBaseCalendar, setDescription, setTimeZonepublic MonthlyCalendar(@Nonnull MonthlyCalendar aOther)
public MonthlyCalendar()
public MonthlyCalendar(ICalendar baseCalendar)
public MonthlyCalendar(TimeZone timeZone)
public boolean[] getDaysExcluded()
Get the array which defines the exclude-value of each day of month. Only the first 31 elements of the array are relevant, with the 0 index element representing the first day of the month.
public boolean isDayExcluded(int day)
Return true, if day is defined to be excluded.
day - The day of the month (from 1 to 31) to check.public void setDaysExcluded(boolean[] days)
Redefine the array of days excluded. The array must non-null and of size greater or equal to 31. The 0 index element represents the first day of the month.
public void setDayExcluded(int day,
boolean exclude)
Redefine a certain day of the month to be excluded (true) or included (false).
day - The day of the month (from 1 to 31) to set.public boolean areAllDaysExcluded()
Check if all days are excluded. That is no day is included.
public 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 ICalendarisTimeIncluded in class AbstractCalendar<MonthlyCalendar>ICalendar.isTimeIncluded(long)public long getNextIncludedTime(long nTimeStamp)
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 ICalendargetNextIncludedTime in class AbstractCalendar<MonthlyCalendar>ICalendar.getNextIncludedTime(long)@Nonnull public MonthlyCalendar getClone()
Copyright © 2016–2021 Philip Helger. All rights reserved.