public class WeeklyCalendar extends AbstractCalendar<WeeklyCalendar>
This implementation of the Calendar excludes a set of days of the week. You may use it to exclude weekends for example. But you may define any day of the week. By default it excludes SATURDAY and SUNDAY.
ICalendar,
AbstractCalendar| Constructor and Description |
|---|
WeeklyCalendar() |
WeeklyCalendar(ICalendar baseCalendar) |
WeeklyCalendar(ICalendar baseCalendar,
TimeZone timeZone) |
WeeklyCalendar(TimeZone timeZone) |
WeeklyCalendar(WeeklyCalendar aOther) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areAllDaysExcluded()
Check if all week days are excluded.
|
WeeklyCalendar |
getClone() |
boolean[] |
getDaysExcluded()
Get the array with the week days
|
long |
getNextIncludedTime(long nTimeStamp)
Determine the next time (in milliseconds) that is 'included' by the
Calendar after the given time.
|
boolean |
isDayExcluded(int wday)
Return true, if wday (see Calendar.get()) is defined to be exluded.
|
boolean |
isTimeIncluded(long timeStamp)
Determine whether the given time (in milliseconds) is 'included' by the
Calendar.
|
void |
setDayExcluded(int wday,
boolean exclude)
Redefine a certain day of the week to be excluded (true) or included
(false).
|
void |
setDaysExcluded(boolean[] weekDays)
Redefine the array of days excluded.
|
createJavaCalendar, createJavaCalendar, getBaseCalendar, getDescription, getEndOfDayJavaCalendar, getStartOfDayJavaCalendar, getTimeZone, setBaseCalendar, setDescription, setTimeZonepublic WeeklyCalendar(@Nonnull WeeklyCalendar aOther)
public WeeklyCalendar()
public WeeklyCalendar(ICalendar baseCalendar)
public WeeklyCalendar(TimeZone timeZone)
public boolean[] getDaysExcluded()
Get the array with the week days
public boolean isDayExcluded(int wday)
Return true, if wday (see Calendar.get()) is defined to be exluded. E. g. saturday and sunday.
public void setDaysExcluded(boolean[] weekDays)
Redefine the array of days excluded. The array must of size greater or equal 8. Calendar's constants like MONDAY should be used as index. A value of true is regarded as: exclude it.
public void setDayExcluded(int wday,
boolean exclude)
Redefine a certain day of the week to be excluded (true) or included (false). Use Calendar's constants like MONDAY to determine the wday.
public boolean areAllDaysExcluded()
Check if all week 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<WeeklyCalendar>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<WeeklyCalendar>ICalendar.getNextIncludedTime(long)@Nonnull public WeeklyCalendar getClone()
Copyright © 2016–2021 Philip Helger. All rights reserved.