Class CalendarEventProvider

java.lang.Object
com.webmethods.caf.faces.data.calendar.CalendarEventProvider
All Implemented Interfaces:
ICalendarEventProvider

public class CalendarEventProvider extends Object implements ICalendarEventProvider
Simple provider wrapper around a list of ICalendarEvents
  • Field Details

    • m_eventList

      protected List<ICalendarEvent> m_eventList
    • m_filteredEventList

      protected List<ICalendarEvent> m_filteredEventList
    • m_filterStartDate

      protected Date m_filterStartDate
    • m_filterEndDate

      protected Date m_filterEndDate
  • Constructor Details

    • CalendarEventProvider

      public CalendarEventProvider()
      Default constructor
    • CalendarEventProvider

      public CalendarEventProvider(List<ICalendarEvent> eventsList)
      Constructor to set the list of calendar events for this provider.
      Parameters:
      eventsList - A list of ICalendarEvent objects.
    • CalendarEventProvider

      public CalendarEventProvider(ICalendarEvent[] eventsArray)
      Constructor to set the list of calendar events for this provider from a array.
      Parameters:
      eventsArray - An array of ICalendarEvent objects.
  • Method Details

    • getEventList

      public List<ICalendarEvent> 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 interface ICalendarEventProvider
      Returns:
      List A list of events for this provider. If list is null, returns EMPTY_LIST
    • setEventList

      public void setEventList(List<ICalendarEvent> eventList)
      Set the event list of calendar events for this provider.
      Parameters:
      eventList - List of calendar events.
    • setStartDate

      public void setStartDate(Date startDate)
      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 interface ICalendarEventProvider
      Parameters:
      startDate - The date to exclude events before this date
    • getStartDate

      public 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

      public void setEndDate(Date endDate)
      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 interface ICalendarEventProvider
      Parameters:
      endDate - The date to exclude events after this date
    • getEndDate

      public 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

      protected List<ICalendarEvent> 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)