Class CalendarEventProvider
java.lang.Object
com.webmethods.caf.faces.data.calendar.CalendarEventProvider
- All Implemented Interfaces:
ICalendarEventProvider
Simple provider wrapper around a list of ICalendarEvents
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ICalendarEvent>
protected List<ICalendarEvent>
protected Date
protected Date
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCalendarEventProvider
(ICalendarEvent[] eventsArray) Constructor to set the list of calendar events for this provider from a array.CalendarEventProvider
(List<ICalendarEvent> eventsList) Constructor to set the list of calendar events for this provider. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
filterCalendarEventList
(List<ICalendarEvent> in, List<ICalendarEvent> out, Date startDate, Date endDate) Get the end date, of the date range, used in filtering the list of calendar eventsGet the list of events contained by this provider.protected List<ICalendarEvent>
Filter the event list using the start and end dates.Get the start date, of the date range, used in filtering the list of calendar eventsprotected boolean
Determines if the start or end date have been set.void
setEndDate
(Date endDate) Set the end date of the date range for this provider.void
setEventList
(List<ICalendarEvent> eventList) Set the event list of calendar events for this provider.void
setStartDate
(Date startDate) Set the start date of the date range for this provider.
-
Field Details
-
m_eventList
-
m_filteredEventList
-
m_filterStartDate
-
m_filterEndDate
-
-
Constructor Details
-
CalendarEventProvider
public CalendarEventProvider()Default constructor -
CalendarEventProvider
Constructor to set the list of calendar events for this provider.- Parameters:
eventsList
- A list of ICalendarEvent objects.
-
CalendarEventProvider
Constructor to set the list of calendar events for this provider from a array.- Parameters:
eventsArray
- An array of ICalendarEvent objects.
-
-
Method Details
-
getEventList
Get the list of events contained by this provider. If the start date or end date are not defined then the entire list is returned. Otherwise a list of calendar events that occur after the start date and before the end date are returned.- Specified by:
getEventList
in interfaceICalendarEventProvider
- Returns:
- List
A list of events for this provider. If list is null, returns EMPTY_LIST
-
setEventList
Set the event list of calendar events for this provider.- Parameters:
eventList
- List of calendar events.
-
setStartDate
Set the start date of the date range for this provider. Setting the date to null, clears the start date. Clears filtered list of calendar events.- Specified by:
setStartDate
in interfaceICalendarEventProvider
- Parameters:
startDate
- The date to exclude events before this date
-
getStartDate
Get the start date, of the date range, used in filtering the list of calendar events- Returns:
- The date object passed in by setStartDate.
-
setEndDate
Set the end date of the date range for this provider. Setting the date to null, clears the end date. Clears filtered list of calendar events.- Specified by:
setEndDate
in interfaceICalendarEventProvider
- Parameters:
endDate
- The date to exclude events after this date
-
getEndDate
Get the end date, of the date range, used in filtering the list of calendar events- Returns:
- The date object passed in by setEndDate.
-
hasFilter
protected boolean hasFilter()Determines if the start or end date have been set. Setting either to null, clear them.- Returns:
- True if end or start date are set, otherwise false.
-
getFilteredEventList
Filter the event list using the start and end dates. Cache the results. This excludes all events before the start date and after the end date. A start date must be defined or the list will be empty. A end date is optional.- Returns:
- A list of calendar events bound by the start and end date.
-
filterCalendarEventList
public static void filterCalendarEventList(List<ICalendarEvent> in, List<ICalendarEvent> out, Date startDate, Date endDate)
-