Package com.uc4.api.objects
Class CalendarKeyword
java.lang.Object
com.uc4.api.objects.CalendarKeyword
- Direct Known Subclasses:
GroupCalendarKeyword
,MonthlyCalendarKeyword
,RollCalendarKeyword
,StaticCalendarKeyword
,WeeklyCalendarKeyword
,YearlyCalendarKeyword
Calendar Keyword.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsDate
(DateTime date) Checks if a date matches this keyword.boolean
Returns the parent calendar object name, this is necessary to identify a calendar keywordReturns the insert string in case errorMessageNumber is not 0.int
Returns the number of the error message or0
if there is no error in this calendar keyword.Returns the text of the error message ornull
if there is no error in this calendar keyword.getName()
Returns the name of the Calendar Keyword.int
hashCode()
protected void
abstract boolean
isGroup()
Returnstrue
if this is a group keyword.abstract boolean
Returnstrue
if this is a monthly keyword.abstract boolean
isRoll()
Returnstrue
if this is a roll keyword.abstract boolean
isStatic()
Returnstrue
if this is a static keyword.abstract boolean
isWeekly()
Returnstrue
if this is a weekly keyword.abstract boolean
isYearly()
Returnstrue
if this is a yearly keyword.protected void
loadCalculatedDays
(Element keyword) protected abstract void
Saves the keyword under the specified parent elementprotected void
setCalendarName
(String name) void
setErrorMessageInsert
(String errorMessageInsert) Sets the error message insert.protected void
setErrorMessageNumber
(int errorMessageNumber) protected void
setErrorText
(String errorText) void
setName
(UC4ObjectName name) Sets the name of the Calendar Keyword.toString()
-
Constructor Details
-
CalendarKeyword
public CalendarKeyword()
-
-
Method Details
-
getErrorMessageNumber
public int getErrorMessageNumber()Returns the number of the error message or0
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
Returns the insert string in case errorMessageNumber is not 0.- Returns:
- Insert
-
getErrorText
Returns the text of the error message ornull
if there is no error in this calendar keyword.- Returns:
- Error message
-
setErrorMessageNumber
protected void setErrorMessageNumber(int errorMessageNumber) -
setErrorText
-
setErrorMessageInsert
Sets the error message insert.- Parameters:
errorMessageInsert
- Insert
-
getName
Returns the name of the Calendar Keyword.- Returns:
- UC4ObjectName containing the calendar keyword
-
setName
Sets the name of the Calendar Keyword.- Parameters:
name
- UC4ObjectName containing the calendar keyword
-
isStatic
public abstract boolean isStatic()Returnstrue
if this is a static keyword.- Returns:
- Boolean containing true in case of a static keyword
-
isWeekly
public abstract boolean isWeekly()Returnstrue
if this is a weekly keyword.- Returns:
- Boolean containing true in case of a weekly keyword
-
isMonthly
public abstract boolean isMonthly()Returnstrue
if this is a monthly keyword.- Returns:
- Boolean containing true in case of a monthly keyword
-
isYearly
public abstract boolean isYearly()Returnstrue
if this is a yearly keyword.- Returns:
- Boolean containing true in case of a yearly keyword
-
isGroup
public abstract boolean isGroup()Returnstrue
if this is a group keyword.- Returns:
- Boolean containing true in case of a group keyword
-
isRoll
public abstract boolean isRoll()Returnstrue
if this is a roll keyword.- Returns:
- Boolean containing true in case of a roll keyword
-
save
Saves the keyword under the specified parent element- Parameters:
doc
- XML Documentparent
- Parent element
-
setCalendarName
-
getCalendarName
Returns the parent calendar object name, this is necessary to identify a calendar keyword- Returns:
- object name of the parent calendar object
-
equals
-
hashCode
public int hashCode() -
toString
-
invalidateCalculatedDates
protected void invalidateCalculatedDates() -
containsDate
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
-
getPreCalculatedDates
- Returns:
- a unmodifyable view on the precalculated dates
-