Class StaticCalendarKeyword

  • All Implemented Interfaces:
    java.lang.Iterable<DateTime>

    public class StaticCalendarKeyword
    extends CalendarKeyword
    implements java.lang.Iterable<DateTime>
    This class represents a static calendar keyword.
    • Constructor Detail

      • StaticCalendarKeyword

        public StaticCalendarKeyword​(UC4ObjectName name,
                                     DateTime from,
                                     DateTime to)
        Constructs a new StaticCalendarKeyword using the specified name and date range.
        Parameters:
        name - Name of the Calendar Keyword
        from - Start date where the calendar keyword is valid
        to - End date until the calendar keyword is valid
      • StaticCalendarKeyword

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

      • iterator

        public java.util.Iterator<DateTime> iterator()
        Returns an iterator over DateTime. This iterator can be used to read or delete dates in this static calendar keyword.
        Specified by:
        iterator in interface java.lang.Iterable<DateTime>
        Returns:
        Iterator over dates in this static calendar keyword
      • add

        public void add​(DateTime date)
        Adds a new date to this static calendar keyword.
        Parameters:
        date - DateTime containing the Date that should be added
      • remove

        public boolean remove​(DateTime date)
        Removes the specified date from this static calendar keyword.
        Parameters:
        date - DateTime which should be removed
        Returns:
        True if and only if the date was removed successfully.
      • clear

        public void clear()
        Removes all dates from this static calendar keyword.
      • getValidFrom

        public DateTime getValidFrom()
        Returns the start date of the validity period.
        Returns:
        DateTime containing the start date of the validity period
      • setValidFrom

        public void setValidFrom​(DateTime validFrom)
        Sets the start date of the validity period.
        Parameters:
        validFrom - DateTime containing the start date of the validity period
      • getValidTo

        public DateTime getValidTo()
        Returns the end date of the validity period.
        Returns:
        DateTime containing the end date of the validity period
      • setValidTo

        public void setValidTo​(DateTime validTo)
        Sets the end date of the validity period.
        Parameters:
        validTo - DateTime containing the end date of the validity period
      • 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