Package org.opencms.widgets.serialdate
Class A_CmsSerialDateBean
java.lang.Object
org.opencms.widgets.serialdate.A_CmsSerialDateBean
- All Implemented Interfaces:
I_CmsSerialDateBean
- Direct Known Subclasses:
CmsSerialDateBeanDaily
,CmsSerialDateBeanIndividual
,CmsSerialDateBeanMonthly
,CmsSerialDateBeanMonthlyWeeks
,CmsSerialDateBeanSingle
,CmsSerialDateBeanWeekly
,CmsSerialDateBeanWorkingDays
,CmsSerialDateBeanYearly
,CmsSerialDateBeanYearlyWeekday
Abstract base class for serial date beans.
It deals with information common for all serial dates and already provides part of the implementation
for calculating all dates of the series.
-
Field Summary
Modifier and TypeFieldDescriptionVariable for caching the dates of the event after lazy calculation.Variable for caching the dates of the event after lazy calculation.Variable for caching the dates as long.protected Calendar
The end date and time of the (potentially) first event of the series.protected long
The exact time the event should occur latest (in milliseconds).protected I_CmsSerialDateValue.EndType
The end type of the series.The list of exceptions.protected int
The maximal number of occurrences of the event.protected Calendar
The date of the last day, the event should occur.protected Calendar
The start date and time of the (potentially) first event of the series.static final int
The maximal number of occurrences that is allowed. -
Constructor Summary
ConstructorDescriptionA_CmsSerialDateBean
(Date startDate, Date endDate, boolean isWholeDay, I_CmsSerialDateValue.EndType endType, Date serialEndDate, int occurrences, SortedSet<Date> exceptions) Constructor for the abstract class for serial date beans. -
Method Summary
Modifier and TypeMethodDescriptiongetDates()
Returns all dates of the whole series asDate
objects, sorted ascendingly.Returns all dates of the whole series in milliseconds, sorted ascendingly.Returns the duration of a single event in milliseconds, ornull
if no end date is specified.Returns all exceptions from the series, sorted ascendingly.protected abstract Calendar
Generates the first date of the series.int
Returns the occurrences of a defined series interval, used for the series end type.Returns the serial end date if the series is of type: ending at specific date.Returns the end type of the date series (never, n times, specific date).Returns the date provided as the earliest date the event should take place.boolean
Returns a flag, indicating if the series has more dates than allowed.protected abstract boolean
Check, if the series can have at least one event/date.protected boolean
showMoreEntries
(Calendar nextDate, int previousOccurrences) Check if the provided date or any date after it are part of the series.protected abstract void
toNextDate
(Calendar date) Starting with a date that's in the series, the next date is created.
-
Field Details
-
MAX_OCCURRENCES
The maximal number of occurrences that is allowed.- See Also:
-
m_startDate
The start date and time of the (potentially) first event of the series. -
m_endDate
The end date and time of the (potentially) first event of the series. -
m_occurrences
The maximal number of occurrences of the event. -
m_serialEndDate
The date of the last day, the event should occur. -
m_endMillis
The exact time the event should occur latest (in milliseconds). -
m_endType
The end type of the series. -
m_dates
Variable for caching the dates of the event after lazy calculation. -
m_allDates
Variable for caching the dates of the event after lazy calculation. -
m_datesInMillis
Variable for caching the dates as long. -
m_exceptions
The list of exceptions.
-
-
Constructor Details
-
Method Details
-
getDates
Description copied from interface:I_CmsSerialDateBean
Returns all dates of the whole series asDate
objects, sorted ascendingly.- Specified by:
getDates
in interfaceI_CmsSerialDateBean
- Returns:
- all dates of the whole series as
Date
objects, sorted ascendingly. - See Also:
-
getDatesAsLong
Description copied from interface:I_CmsSerialDateBean
Returns all dates of the whole series in milliseconds, sorted ascendingly.- Specified by:
getDatesAsLong
in interfaceI_CmsSerialDateBean
- Returns:
- all dates of the whole series in milliseconds, sorted ascendingly.
- See Also:
-
getEventDuration
Description copied from interface:I_CmsSerialDateBean
Returns the duration of a single event in milliseconds, ornull
if no end date is specified.- Specified by:
getEventDuration
in interfaceI_CmsSerialDateBean
- Returns:
- the duration of a single event in milliseconds, or
null
if no end date is specified. - See Also:
-
getExceptions
Description copied from interface:I_CmsSerialDateBean
Returns all exceptions from the series, sorted ascendingly.- Specified by:
getExceptions
in interfaceI_CmsSerialDateBean
- Returns:
- all exceptions from the series, sorted ascendingly.
- See Also:
-
getOccurrences
Returns the occurrences of a defined series interval, used for the series end type.- Returns:
- the occurrences of a defined series interval, used for the series end type
-
getSerialEndDate
Returns the serial end date if the series is of type: ending at specific date.- Returns:
- the serial end date if the series is of type: ending at specific date
-
getSerialEndType
Returns the end type of the date series (never, n times, specific date).- Returns:
- the end type of the date series
-
getStartDate
Returns the date provided as the earliest date the event should take place. The time is set to the starting time of the event.- Returns:
- date where the event should take place earliest with time set to the date's starting time.
-
hasTooManyDates
Description copied from interface:I_CmsSerialDateBean
Returns a flag, indicating if the series has more dates than allowed.- Specified by:
hasTooManyDates
in interfaceI_CmsSerialDateBean
- Returns:
- a flag, indicating if the series has more dates than allowed.
- See Also:
-
getFirstDate
Generates the first date of the series.- Returns:
- the first date of the series.
-
isAnyDatePossible
Check, if the series can have at least one event/date.- Returns:
true
if the series can be non-empty,false
otherwise.
-
showMoreEntries
Check if the provided date or any date after it are part of the series.- Parameters:
nextDate
- the current date to check.previousOccurrences
- the number of events of the series that took place before the date to check.- Returns:
true
if more dates (including the provided one) could be in the series,false
otherwise.
-
toNextDate
Starting with a date that's in the series, the next date is created.- Parameters:
date
- the current event date for a event in the series, which is adjusted to the next date potentially in the series.
-