public class AnnualCalendar extends AbstractCalendar<AnnualCalendar>
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.
ICalendar,
AbstractCalendar| Constructor and Description |
|---|
AnnualCalendar() |
AnnualCalendar(AnnualCalendar aRhs) |
AnnualCalendar(ICalendar baseCalendar) |
AnnualCalendar(ICalendar baseCalendar,
TimeZone timeZone) |
AnnualCalendar(TimeZone timeZone) |
| Modifier and Type | Method and Description |
|---|---|
AnnualCalendar |
getClone() |
com.helger.commons.collection.impl.ICommonsList<Calendar> |
getDaysExcluded() |
long |
getNextIncludedTime(long nTimeStamp)
Determine the next time (in milliseconds) that is 'included' by the
Calendar after the given time.
|
boolean |
isDayExcluded(Calendar day) |
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(List<Calendar> days)
Redefine the list of days excluded.
|
createJavaCalendar, createJavaCalendar, getBaseCalendar, getDescription, getEndOfDayJavaCalendar, getStartOfDayJavaCalendar, getTimeZone, setBaseCalendar, setDescription, setTimeZonepublic AnnualCalendar(@Nonnull AnnualCalendar aRhs)
public AnnualCalendar()
public AnnualCalendar(ICalendar baseCalendar)
public AnnualCalendar(TimeZone timeZone)
@ReturnsMutableObject public com.helger.commons.collection.impl.ICommonsList<Calendar> getDaysExcluded()
public boolean isDayExcluded(@Nonnull Calendar day)
day - day to check. May not be null.true if day is defined to be excluded.public void setDaysExcluded(@Nullable List<Calendar> days)
Calendar objects.days - The days to be excludedpublic void setDayExcluded(Calendar day, boolean exclude)
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 ICalendarisTimeIncluded in class AbstractCalendar<AnnualCalendar>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<AnnualCalendar>ICalendar.getNextIncludedTime(long)@Nonnull @ReturnsMutableCopy public AnnualCalendar getClone()
Copyright © 2016–2021 Philip Helger. All rights reserved.