public abstract class A_CmsSerialDateBean extends java.lang.Object implements I_CmsSerialDateBean
| Modifier and Type | Field and Description |
|---|---|
protected java.util.SortedSet<java.util.Date> |
m_allDates
Variable for caching the dates of the event after lazy calculation.
|
protected java.util.SortedSet<java.util.Date> |
m_dates
Variable for caching the dates of the event after lazy calculation.
|
protected java.util.SortedSet<java.lang.Long> |
m_datesInMillis
Variable for caching the dates as long.
|
protected java.util.Calendar |
m_endDate
The end date and time of the (potentially) first event of the series.
|
protected long |
m_endMillis
The exact time the event should occur latest (in milliseconds).
|
protected I_CmsSerialDateValue.EndType |
m_endType
The end type of the series.
|
protected java.util.SortedSet<java.util.Date> |
m_exceptions
The list of exceptions.
|
protected int |
m_occurrences
The maximal number of occurrences of the event.
|
protected java.util.Calendar |
m_serialEndDate
The date of the last day, the event should occur.
|
protected java.util.Calendar |
m_startDate
The start date and time of the (potentially) first event of the series.
|
static int |
MAX_OCCURRENCES
The maximal number of occurrences that is allowed.
|
| Constructor and Description |
|---|
A_CmsSerialDateBean(java.util.Date startDate,
java.util.Date endDate,
boolean isWholeDay,
I_CmsSerialDateValue.EndType endType,
java.util.Date serialEndDate,
int occurrences,
java.util.SortedSet<java.util.Date> exceptions)
Constructor for the abstract class for serial date beans.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.SortedSet<java.util.Date> |
getDates()
Returns all dates of the whole series as
Date objects, sorted ascendingly. |
java.util.SortedSet<java.lang.Long> |
getDatesAsLong()
Returns all dates of the whole series in milliseconds, sorted ascendingly.
|
java.lang.Long |
getEventDuration()
Returns the duration of a single event in milliseconds, or
null if no end date is specified. |
java.util.SortedSet<java.util.Date> |
getExceptions()
Returns all exceptions from the series, sorted ascendingly.
|
protected abstract java.util.Calendar |
getFirstDate()
Generates the first date of the series.
|
int |
getOccurrences()
Returns the occurrences of a defined series interval, used for the series end type.
|
java.util.Calendar |
getSerialEndDate()
Returns the serial end date if the series is of type: ending at specific date.
|
I_CmsSerialDateValue.EndType |
getSerialEndType()
Returns the end type of the date series (never, n times, specific date).
|
java.util.Calendar |
getStartDate()
Returns the date provided as the earliest date the event should take place.
|
boolean |
hasTooManyDates()
Returns a flag, indicating if the series has more dates than allowed.
|
protected abstract boolean |
isAnyDatePossible()
Check, if the series can have at least one event/date.
|
protected boolean |
showMoreEntries(java.util.Calendar nextDate,
int previousOccurrences)
Check if the provided date or any date after it are part of the series.
|
protected abstract void |
toNextDate(java.util.Calendar date)
Starting with a date that's in the series, the next date is created.
|
public static final int MAX_OCCURRENCES
protected java.util.Calendar m_startDate
protected java.util.Calendar m_endDate
protected int m_occurrences
protected java.util.Calendar m_serialEndDate
protected long m_endMillis
protected I_CmsSerialDateValue.EndType m_endType
protected java.util.SortedSet<java.util.Date> m_dates
protected java.util.SortedSet<java.util.Date> m_allDates
protected java.util.SortedSet<java.lang.Long> m_datesInMillis
protected final java.util.SortedSet<java.util.Date> m_exceptions
public A_CmsSerialDateBean(java.util.Date startDate, java.util.Date endDate, boolean isWholeDay, I_CmsSerialDateValue.EndType endType, java.util.Date serialEndDate, int occurrences, java.util.SortedSet<java.util.Date> exceptions)
startDate - the start date of the series as provided by the serial date widget.endDate - the end date of the series as provided by the serial date widget.isWholeDay - flag, indicating if the event lasts the whole day.endType - the end type of the series as provided by the serial date widget.serialEndDate - the end date of the series as provided by the serial date widget.occurrences - the maximal number of occurrences of the event as provided by the serial date widget.
If endType is DATE, this parameter is ignored.exceptions - the dates not part of the list.public java.util.SortedSet<java.util.Date> getDates()
I_CmsSerialDateBeanDate objects, sorted ascendingly.getDates in interface I_CmsSerialDateBeanDate objects, sorted ascendingly.I_CmsSerialDateBean.getDates()public java.util.SortedSet<java.lang.Long> getDatesAsLong()
I_CmsSerialDateBeangetDatesAsLong in interface I_CmsSerialDateBeanI_CmsSerialDateBean.getDatesAsLong()public java.lang.Long getEventDuration()
I_CmsSerialDateBeannull if no end date is specified.getEventDuration in interface I_CmsSerialDateBeannull if no end date is specified.I_CmsSerialDateBean.getEventDuration()public java.util.SortedSet<java.util.Date> getExceptions()
I_CmsSerialDateBeangetExceptions in interface I_CmsSerialDateBeanI_CmsSerialDateBean.getExceptions()public int getOccurrences()
public java.util.Calendar getSerialEndDate()
public I_CmsSerialDateValue.EndType getSerialEndType()
public java.util.Calendar getStartDate()
public boolean hasTooManyDates()
I_CmsSerialDateBeanhasTooManyDates in interface I_CmsSerialDateBeanI_CmsSerialDateBean.hasTooManyDates()protected abstract java.util.Calendar getFirstDate()
protected abstract boolean isAnyDatePossible()
true if the series can be non-empty, false otherwise.protected boolean showMoreEntries(java.util.Calendar nextDate, int previousOccurrences)
nextDate - the current date to check.previousOccurrences - the number of events of the series that took place before the date to check.true if more dates (including the provided one) could be in the series, false otherwise.protected abstract void toNextDate(java.util.Calendar date)
date - the current event date for a event in the series, which is adjusted to the next date potentially in the series.