Class DayItem


  • public class DayItem
    extends java.lang.Object
    Representation of a day for the outer recyclerview in the MainActivity. Contains two sub-RecyclerViews, represented by EventItem and TaskItem.
    Author:
    Evan Voogd
    • Constructor Summary

      Constructors 
      Constructor Description
      DayItem​(java.lang.String dayString, java.util.List<EventItem> events, java.util.List<TaskItem> tasks, int index)
      Creates a DayItem to be used in MainActivity's recyclerview
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDayString()
      Returns string representing the day this DayItem represents
      java.util.List<EventItem> getEvents()
      Returns the List of EventItems to be displayed in recyclerview
      int getIndex()
      Returns how many days past today's date this DayItem represents, which can be used as an index into the taskSchedule/eventSchedule ArrayLists for easy completion/deletion of events and tasks without using convoluted recycler index logic.
      java.util.List<TaskItem> getTasks()
      Returns the List of TaskItems to be displayed in recyclerview
      void setDayString​(java.lang.String dayString)
      Sets the string representing the day this DayItem represents
      void setEvents​(java.util.List<EventItem> events)
      Sets the List of EventItems to be displayed in recyclerview
      void setTasks​(java.util.List<TaskItem> tasks)
      Sets the List of TaskItems to be displayed in recyclerview
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mDayString

        private java.lang.String mDayString
      • mEvents

        private java.util.List<EventItem> mEvents
      • mTasks

        private java.util.List<TaskItem> mTasks
      • mIndex

        private final int mIndex
    • Constructor Detail

      • DayItem

        public DayItem​(java.lang.String dayString,
                       java.util.List<EventItem> events,
                       java.util.List<TaskItem> tasks,
                       int index)
        Creates a DayItem to be used in MainActivity's recyclerview
        Parameters:
        dayString - string of the day this DayItem represents
        events - list of EventItems to be displayed in recyclerview
        tasks - list of TaskItems to be displayed in recyclerview
        index - how many days past today's date this DayItem represents
    • Method Detail

      • getIndex

        public int getIndex()
        Returns how many days past today's date this DayItem represents, which can be used as an index into the taskSchedule/eventSchedule ArrayLists for easy completion/deletion of events and tasks without using convoluted recycler index logic.
        Returns:
        index into task/eventSchedule representing this DayItem
      • getDayString

        public java.lang.String getDayString()
        Returns string representing the day this DayItem represents
        Returns:
        a string representing the day this DayItem represents
      • setDayString

        public void setDayString​(java.lang.String dayString)
        Sets the string representing the day this DayItem represents
        Parameters:
        dayString - a string representing the day this DayItem represents
      • getEvents

        public java.util.List<EventItem> getEvents()
        Returns the List of EventItems to be displayed in recyclerview
        Returns:
        a List of EventItems to be displayed in recyclerview
      • setEvents

        public void setEvents​(java.util.List<EventItem> events)
        Sets the List of EventItems to be displayed in recyclerview
        Parameters:
        events - a List of EventItems to be displayed in recyclerview
      • getTasks

        public java.util.List<TaskItem> getTasks()
        Returns the List of TaskItems to be displayed in recyclerview
        Returns:
        a List of TaskItems to be displayed in recyclerview
      • setTasks

        public void setTasks​(java.util.List<TaskItem> tasks)
        Sets the List of TaskItems to be displayed in recyclerview
        Parameters:
        tasks - a List of TaskItems to be displayed in recyclerview