Class CalendarKeyword

    • Constructor Summary

      Constructors 
      Constructor Description
      CalendarKeyword()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsDate​(DateTime date)
      Checks if a date matches this keyword.
      boolean equals​(java.lang.Object obj)  
      java.lang.String getCalendarName()
      Returns the parent calendar object name, this is necessary to identify a calendar keyword
      java.lang.String getErrorMessageInsert()
      Returns the insert string in case errorMessageNumber is not 0.
      int getErrorMessageNumber()
      Returns the number of the error message or 0 if there is no error in this calendar keyword.
      java.lang.String getErrorText()
      Returns the text of the error message or null if there is no error in this calendar keyword.
      UC4ObjectName getName()
      Returns the name of the Calendar Keyword.
      java.util.SortedSet<DateTime> getPreCalculatedDates()  
      int hashCode()  
      protected void invalidateCalculatedDates()  
      abstract boolean isGroup()
      Returns true if this is a group keyword.
      abstract boolean isMonthly()
      Returns true if this is a monthly keyword.
      abstract boolean isRoll()
      Returns true if this is a roll keyword.
      abstract boolean isStatic()
      Returns true if this is a static keyword.
      abstract boolean isWeekly()
      Returns true if this is a weekly keyword.
      abstract boolean isYearly()
      Returns true if this is a yearly keyword.
      protected void loadCalculatedDays​(org.w3c.dom.Element keyword)  
      protected abstract void save​(com.uc4.util.XMLDocument doc, org.w3c.dom.Element parent)
      Saves the keyword under the specified parent element
      protected void setCalendarName​(java.lang.String name)  
      void setErrorMessageInsert​(java.lang.String errorMessageInsert)
      Sets the error message insert.
      protected void setErrorMessageNumber​(int errorMessageNumber)  
      protected void setErrorText​(java.lang.String errorText)  
      void setName​(UC4ObjectName name)
      Sets the name of the Calendar Keyword.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CalendarKeyword

        public CalendarKeyword()
    • Method Detail

      • getErrorMessageNumber

        public int getErrorMessageNumber()
        Returns the number of the error message or 0 if there is no error in this calendar keyword.
        Returns:
        Integer containing the number of error message or 0 if there is no error
      • getErrorMessageInsert

        public java.lang.String getErrorMessageInsert()
        Returns the insert string in case errorMessageNumber is not 0.
        Returns:
        Insert
      • getErrorText

        public java.lang.String getErrorText()
        Returns the text of the error message or null if there is no error in this calendar keyword.
        Returns:
        Error message
      • setErrorMessageNumber

        protected void setErrorMessageNumber​(int errorMessageNumber)
      • setErrorText

        protected void setErrorText​(java.lang.String errorText)
      • setErrorMessageInsert

        public void setErrorMessageInsert​(java.lang.String errorMessageInsert)
        Sets the error message insert.
        Parameters:
        errorMessageInsert - Insert
      • getName

        public UC4ObjectName getName()
        Returns the name of the Calendar Keyword.
        Returns:
        UC4ObjectName containing the calendar keyword
      • setName

        public void setName​(UC4ObjectName name)
        Sets the name of the Calendar Keyword.
        Parameters:
        name - UC4ObjectName containing the calendar keyword
      • isStatic

        public abstract boolean isStatic()
        Returns true if this is a static keyword.
        Returns:
        Boolean containing true in case of a static keyword
      • isWeekly

        public abstract boolean isWeekly()
        Returns true if this is a weekly keyword.
        Returns:
        Boolean containing true in case of a weekly keyword
      • isMonthly

        public abstract boolean isMonthly()
        Returns true if this is a monthly keyword.
        Returns:
        Boolean containing true in case of a monthly keyword
      • isYearly

        public abstract boolean isYearly()
        Returns true if this is a yearly keyword.
        Returns:
        Boolean containing true in case of a yearly keyword
      • isGroup

        public abstract boolean isGroup()
        Returns true if this is a group keyword.
        Returns:
        Boolean containing true in case of a group keyword
      • isRoll

        public abstract boolean isRoll()
        Returns true if this is a roll keyword.
        Returns:
        Boolean containing true in case of a roll keyword
      • save

        protected abstract void save​(com.uc4.util.XMLDocument doc,
                                     org.w3c.dom.Element parent)
        Saves the keyword under the specified parent element
        Parameters:
        doc - XML Document
        parent - Parent element
      • setCalendarName

        protected void setCalendarName​(java.lang.String name)
      • getCalendarName

        public java.lang.String getCalendarName()
        Returns the parent calendar object name, this is necessary to identify a calendar keyword
        Returns:
        object name of the parent calendar object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • invalidateCalculatedDates

        protected void invalidateCalculatedDates()
      • containsDate

        public boolean containsDate​(DateTime date)
        Checks if a date matches this keyword. This method works with any type of keyword (roll, group, ...) It uses the precalculated dates from the Automation Engine. Therefore this method can only be called if no modification has been made to this keyword. If the keyword has been modified it is necessary to save and reopen this calendar in order to get a new list of calculated dates.
        Parameters:
        date - Date to check
        Returns:
        true if the specified date is part of this calendar keyword
      • loadCalculatedDays

        protected void loadCalculatedDays​(org.w3c.dom.Element keyword)
      • getPreCalculatedDates

        public java.util.SortedSet<DateTime> getPreCalculatedDates()
        Returns:
        a unmodifyable view on the precalculated dates