Package com.uc4.api.objects
Class MonthlyCalendarKeyword
java.lang.Object
com.uc4.api.objects.CalendarKeyword
com.uc4.api.objects.MonthlyCalendarKeyword
This class represents a monthly calendar keyword.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a newMonthlyCalendarKeyword
.MonthlyCalendarKeyword
(UC4ObjectName name, int nMonth, int startMonth, int endMonth) Constructs a newMonthlyCalendarKeyword
.protected
MonthlyCalendarKeyword
(Element keyword, String string) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a day to the selected days.int
Returns the number of the end month of the monthly interval.Returns the end day of the interval.int
Returns the interval in days.Returns the start day of the interval.int
Returns the period in month.int
Returns the number of the start month of the monthly interval.boolean
Returnstrue
if this yearly keyword has a defined interval.void
inDefinedInterval
(int everyNday, boolean beginOfMonth, Integer start, Integer end) Defines an interval for this monthly keyword.boolean
isGroup()
Returnstrue
if this is a group keyword.boolean
Returns the direction for counting the days.boolean
Returnstrue
if this is a monthly keyword.boolean
Returnstrue
if the definition of calendar days is selected.boolean
isRoll()
Returnstrue
if this is a roll keyword.boolean
isStatic()
Returnstrue
if this is a static keyword.boolean
isWeekly()
Returnstrue
if this is a weekly keyword.boolean
isYearly()
Returnstrue
if this is a yearly keyword.boolean
removeDate
(Integer day) Removes the specified day from the selected days.protected void
Saves the keyword under the specified parent elementReturns an iterator overInteger
.void
selectOnDefinedCalendarDays
(boolean beginOfMonth) If this method is called the selected calendar days are used.void
setEndMonth
(int endMonth) Sets the number of the end month of the monthly interval.void
setNMonth
(int month) Sets the period in month.void
setStartMonth
(int startMonth) Sets the number of the start month of the monthly interval.Methods inherited from class com.uc4.api.objects.CalendarKeyword
containsDate, equals, getCalendarName, getErrorMessageInsert, getErrorMessageNumber, getErrorText, getName, getPreCalculatedDates, hashCode, invalidateCalculatedDates, loadCalculatedDays, setCalendarName, setErrorMessageInsert, setErrorMessageNumber, setErrorText, setName, toString
-
Constructor Details
-
MonthlyCalendarKeyword
-
MonthlyCalendarKeyword
Constructs a newMonthlyCalendarKeyword
.- Parameters:
name
- Name of the calendar keywordnMonth
- Every n month, integer between 1 and 12startMonth
- Start from month, integer beetween 1 and 12endMonth
- End with month, integer beetween 1 and 12
-
MonthlyCalendarKeyword
Constructs a newMonthlyCalendarKeyword
. 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()Returnstrue
if the definition of calendar days is selected.- Returns:
- Boolean which is set to false if an interval is selected
-
selectedDates
Returns an iterator overInteger
. 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 theIterator
.- Returns:
- Iterator over Integer
-
addDate
Adds a day to the selected days.- Parameters:
day
- Day
-
removeDate
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
Defines an interval for this monthly keyword.- Parameters:
everyNday
- Every n day, integer between 1 and 365beginOfMonth
- Direction for day counting, true means that every n day from the beginning of the year is countedstart
- Start dayend
- 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
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
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()Returnstrue
if this yearly keyword has a defined interval. If this method returnsfalse
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
Returnstrue
if this is a static keyword.- Specified by:
isStatic
in classCalendarKeyword
- Returns:
- Boolean containing true in case of a static keyword
-
isWeekly
public boolean isWeekly()Description copied from class:CalendarKeyword
Returnstrue
if this is a weekly keyword.- Specified by:
isWeekly
in classCalendarKeyword
- Returns:
- Boolean containing true in case of a weekly keyword
-
isMonthly
public boolean isMonthly()Description copied from class:CalendarKeyword
Returnstrue
if this is a monthly keyword.- Specified by:
isMonthly
in classCalendarKeyword
- Returns:
- Boolean containing true in case of a monthly keyword
-
isYearly
public boolean isYearly()Description copied from class:CalendarKeyword
Returnstrue
if this is a yearly keyword.- Specified by:
isYearly
in classCalendarKeyword
- Returns:
- Boolean containing true in case of a yearly keyword
-
isGroup
public boolean isGroup()Description copied from class:CalendarKeyword
Returnstrue
if this is a group keyword.- Specified by:
isGroup
in classCalendarKeyword
- Returns:
- Boolean containing true in case of a group keyword
-
isRoll
public boolean isRoll()Description copied from class:CalendarKeyword
Returnstrue
if this is a roll keyword.- Specified by:
isRoll
in classCalendarKeyword
- Returns:
- Boolean containing true in case of a roll keyword
-
save
Description copied from class:CalendarKeyword
Saves the keyword under the specified parent element- Specified by:
save
in classCalendarKeyword
- Parameters:
doc
- XML Documentparent
- Parent element
-