Class YearlyCalendarKeyword


  • public class YearlyCalendarKeyword
    extends CalendarKeyword
    This class represents a yearly Calendar Keyword.
    • Constructor Detail

      • YearlyCalendarKeyword

        protected YearlyCalendarKeyword​(org.w3c.dom.Element keyword,
                                        java.lang.String string)
      • YearlyCalendarKeyword

        public YearlyCalendarKeyword​(UC4ObjectName name,
                                     int nYear,
                                     int startWithYear)
        Constructs a new YearlyCalendarKeyword.
        Parameters:
        name - Name of the calendar keyword
        nYear - Every n year, integer between 1 and 1000
        startWithYear - Year to start with, integer between 1 and 3000
      • YearlyCalendarKeyword

        public YearlyCalendarKeyword​(UC4ObjectName name)
        Constructs a new YearlyCalendarKeyword. The interval is set to 1 starting with the current year.
        Parameters:
        name - Name of the calendar keyword
    • Method Detail

      • selectOnDefinedCalendarDays

        public void selectOnDefinedCalendarDays()
        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).
      • 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 java.util.Iterator<DateTime> selectedDates()
        Returns an iterator over DateTime. This iterator can be used to read the selected dates and remove dates using the remove method of the Iterator.
        Returns:
        Iterator over DateTime
      • addDate

        public void addDate​(DateTime date)
        Adds a date to the selected dates.
        Parameters:
        date - Date
      • removeDate

        public boolean removeDate​(DateTime date)
        Removes the specified date from the selected dates.
        Parameters:
        date - Date
        Returns:
        True if and only if the date was successfully removed
      • removeAllDates

        public void removeAllDates()
        Removes all selected dates.
      • inDefinedInterval

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

        public boolean isIntervalBeginOfYear()
        Returns true if the beginning of the year is set for the interval.
        Returns:
        Boolean which contains false if the counting starts at the end of the year
      • getIntervalEndDate

        public DateTime getIntervalEndDate()
        Returns the end date of the interval.
        Returns:
        End date of the interval
      • getIntervalEveryDay

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

        public DateTime getIntervalStartDate()
        Returns the start date of the interval.
        Returns:
        Start date of the interval
      • 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
      • getNYear

        public int getNYear()
        Returns the interval in years.
        Returns:
        Integer containg the inverval in years
      • setNYear

        public void setNYear​(int nYear)
        Sets the interval in years.
        Parameters:
        nYear - Integer containg the inverval in years
      • getStartYear

        public int getStartYear()
        Returns the start year for the interval.
        Returns:
        Integer containg the start year
      • setStartYear

        public void setStartYear​(int startYear)
        Sets the start year for the interval.
        Parameters:
        startYear - Integer containg the start year
      • 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,
                            org.w3c.dom.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