Class SimpleCalendarModel

    • Constructor Detail

      • SimpleCalendarModel

        public SimpleCalendarModel​(List<CalendarItem> list,
                                   boolean live)
        Constructor
        Parameters:
        list - the list to represent
        live - whether to have a 'live' CalendarModel on top of the specified list. If false, the content of the specified list is copied. If true, this object is a 'facade' of the specified list, i.e., when you add or remove items from this SimpleCalendarModel, the inner "live" list would be changed accordingly. However, it is not a good idea to modify list if it is passed to this method with live is true, since Calendars is not smart enough to handle it. Instead, modify it thru this object.
      • SimpleCalendarModel

        public SimpleCalendarModel()
        Constructor.
      • SimpleCalendarModel

        public SimpleCalendarModel​(Collection<CalendarItem> c)
        Constructor. It makes a copy of the specified collection (i.e., not live).
      • SimpleCalendarModel

        public SimpleCalendarModel​(CalendarItem[] array)
        Constructor. It makes a copy of the specified array (i.e., not live).
      • SimpleCalendarModel

        public SimpleCalendarModel​(int initialCapacity)
        Constructor.
        Parameters:
        initialCapacity - the initial capacity for this SimpleCalendarModel.
    • Method Detail

      • add

        public void add​(int index,
                        CalendarItem e)
        Adds the calendar item to the specified index of the list.
      • add

        public boolean add​(CalendarItem e)
        Adds the calendar item to the list.
      • update

        public boolean update​(CalendarItem e)
        Update the calendar item to the list.
      • remove

        public CalendarItem remove​(int index)
        Removes the calendar item from the specified index.
      • indexOf

        public int indexOf​(CalendarItem elem)
        Returns the index of the first occurrence of the specified element in this list.
      • remove

        public boolean remove​(CalendarItem e)
        Removes from the specified calendar item.
      • clear

        public void clear()
        Removes all of the elements from this list (optional operation). The list will be empty after this call returns.
      • size

        public int size()
        Returns the number of elements in this list.
      • isTimeOverlapping

        public static boolean isTimeOverlapping​(Date begin1,
                                                Date end1,
                                                Date begin2,
                                                Date end2)