Class MonthlyCalendarKeyword

java.lang.Object
com.uc4.api.objects.CalendarKeyword
com.uc4.api.objects.MonthlyCalendarKeyword

public class MonthlyCalendarKeyword extends CalendarKeyword
This class represents a monthly calendar keyword.
  • Constructor Details

    • MonthlyCalendarKeyword

      protected MonthlyCalendarKeyword(Element keyword, String string)
    • MonthlyCalendarKeyword

      public MonthlyCalendarKeyword(UC4ObjectName name, int nMonth, int startMonth, int endMonth)
      Constructs a new MonthlyCalendarKeyword.
      Parameters:
      name - Name of the calendar keyword
      nMonth - Every n month, integer between 1 and 12
      startMonth - Start from month, integer beetween 1 and 12
      endMonth - End with month, integer beetween 1 and 12
    • MonthlyCalendarKeyword

      public MonthlyCalendarKeyword(UC4ObjectName name)
      Constructs a new MonthlyCalendarKeyword. Every 1 Month starting with month 1 and ending with 12 is selected.
      Parameters:
      name - Name of the calendar keyword
  • Method Details

    • selectOnDefinedCalendarDays

      public void selectOnDefinedCalendarDays(boolean beginOfMonth)
      If this method is called the selected calendar days are used. The definition of calendar days is the default this method should only be called if an interval was set (inDefinedInterval).
      Parameters:
      beginOfMonth - Direction to count the days, if false days are counted from the end of the month
    • isOnDefinedCalendarDays

      public boolean isOnDefinedCalendarDays()
      Returns true if the definition of calendar days is selected.
      Returns:
      Boolean which is set to false if an interval is selected
    • selectedDates

      public Iterator<Integer> selectedDates()
      Returns an iterator over Integer. The integer contains the number of the day. This iterator can be used to read the selected days and remove days using the remove method of the Iterator.
      Returns:
      Iterator over Integer
    • addDate

      public void addDate(Integer day)
      Adds a day to the selected days.
      Parameters:
      day - Day
    • removeDate

      public boolean removeDate(Integer day)
      Removes the specified day from the selected days.
      Parameters:
      day - Day
      Returns:
      True if and only if the date was successfully removed
    • getEndMonth

      public int getEndMonth()
      Returns the number of the end month of the monthly interval.
      Returns:
      End month, integer between 1 and 12
    • setEndMonth

      public void setEndMonth(int endMonth)
      Sets the number of the end month of the monthly interval.
      Parameters:
      endMonth - End month, integer between 1 and 12
    • inDefinedInterval

      public void inDefinedInterval(int everyNday, boolean beginOfMonth, Integer start, Integer end)
      Defines an interval for this monthly keyword.
      Parameters:
      everyNday - Every n day, integer between 1 and 365
      beginOfMonth - Direction for day counting, true means that every n day from the beginning of the year is counted
      start - Start day
      end - End day
    • isIntervalBeginOfMonth

      public boolean isIntervalBeginOfMonth()
      Returns the direction for counting the days.
      Returns:
      Boolean which contains false if the counting starts at the end of the month, true otherwise
    • getIntervalEndDay

      public Integer getIntervalEndDay()
      Returns the end day of the interval.
      Returns:
      End day of the interval
    • getIntervalEveryDay

      public int getIntervalEveryDay()
      Returns the interval in days.
      Returns:
      Interval in days
    • getIntervalStartDay

      public Integer getIntervalStartDay()
      Returns the start day of the interval.
      Returns:
      Start day of the interval
    • getNMonth

      public int getNMonth()
      Returns the period in month. For example if five is returned this means that every five months are selected.
      Returns:
      Integer containing the period
    • setNMonth

      public void setNMonth(int month)
      Sets the period in month. For example if five is returned this means that every five months are selected.
      Parameters:
      month - Integer containing the period
    • getStartMonth

      public int getStartMonth()
      Returns the number of the start month of the monthly interval.
      Returns:
      Start month, integer between 1 and 12
    • setStartMonth

      public void setStartMonth(int startMonth)
      Sets the number of the start month of the monthly interval.
      Parameters:
      startMonth - Start month, integer between 1 and 12
    • hasDefinedInterval

      public boolean hasDefinedInterval()
      Returns true if this yearly keyword has a defined interval. If this method returns false single dates are selected for this yearly keyword.
      Returns:
      Boolean which is set to true if an interval is defined
    • isStatic

      public boolean isStatic()
      Description copied from class: CalendarKeyword
      Returns true if this is a static keyword.
      Specified by:
      isStatic in class CalendarKeyword
      Returns:
      Boolean containing true in case of a static keyword
    • isWeekly

      public boolean isWeekly()
      Description copied from class: CalendarKeyword
      Returns true if this is a weekly keyword.
      Specified by:
      isWeekly in class CalendarKeyword
      Returns:
      Boolean containing true in case of a weekly keyword
    • isMonthly

      public boolean isMonthly()
      Description copied from class: CalendarKeyword
      Returns true if this is a monthly keyword.
      Specified by:
      isMonthly in class CalendarKeyword
      Returns:
      Boolean containing true in case of a monthly keyword
    • isYearly

      public boolean isYearly()
      Description copied from class: CalendarKeyword
      Returns true if this is a yearly keyword.
      Specified by:
      isYearly in class CalendarKeyword
      Returns:
      Boolean containing true in case of a yearly keyword
    • isGroup

      public boolean isGroup()
      Description copied from class: CalendarKeyword
      Returns true if this is a group keyword.
      Specified by:
      isGroup in class CalendarKeyword
      Returns:
      Boolean containing true in case of a group keyword
    • isRoll

      public boolean isRoll()
      Description copied from class: CalendarKeyword
      Returns true if this is a roll keyword.
      Specified by:
      isRoll in class CalendarKeyword
      Returns:
      Boolean containing true in case of a roll keyword
    • save

      protected void save(com.uc4.util.XMLDocument doc, Element parent)
      Description copied from class: CalendarKeyword
      Saves the keyword under the specified parent element
      Specified by:
      save in class CalendarKeyword
      Parameters:
      doc - XML Document
      parent - Parent element