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.protectedMonthlyCalendarKeyword(Element keyword, String string) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a day to the selected days.intReturns the number of the end month of the monthly interval.Returns the end day of the interval.intReturns the interval in days.Returns the start day of the interval.intReturns the period in month.intReturns the number of the start month of the monthly interval.booleanReturnstrueif this yearly keyword has a defined interval.voidinDefinedInterval(int everyNday, boolean beginOfMonth, Integer start, Integer end) Defines an interval for this monthly keyword.booleanisGroup()Returnstrueif this is a group keyword.booleanReturns the direction for counting the days.booleanReturnstrueif this is a monthly keyword.booleanReturnstrueif the definition of calendar days is selected.booleanisRoll()Returnstrueif this is a roll keyword.booleanisStatic()Returnstrueif this is a static keyword.booleanisWeekly()Returnstrueif this is a weekly keyword.booleanisYearly()Returnstrueif this is a yearly keyword.booleanremoveDate(Integer day) Removes the specified day from the selected days.protected voidSaves the keyword under the specified parent elementReturns an iterator overInteger.voidselectOnDefinedCalendarDays(boolean beginOfMonth) If this method is called the selected calendar days are used.voidsetEndMonth(int endMonth) Sets the number of the end month of the monthly interval.voidsetNMonth(int month) Sets the period in month.voidsetStartMonth(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()Returnstrueif 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()Returnstrueif this yearly keyword has a defined interval. If this method returnsfalsesingle 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:CalendarKeywordReturnstrueif this is a static keyword.- Specified by:
isStaticin classCalendarKeyword- Returns:
- Boolean containing true in case of a static keyword
-
isWeekly
public boolean isWeekly()Description copied from class:CalendarKeywordReturnstrueif this is a weekly keyword.- Specified by:
isWeeklyin classCalendarKeyword- Returns:
- Boolean containing true in case of a weekly keyword
-
isMonthly
public boolean isMonthly()Description copied from class:CalendarKeywordReturnstrueif this is a monthly keyword.- Specified by:
isMonthlyin classCalendarKeyword- Returns:
- Boolean containing true in case of a monthly keyword
-
isYearly
public boolean isYearly()Description copied from class:CalendarKeywordReturnstrueif this is a yearly keyword.- Specified by:
isYearlyin classCalendarKeyword- Returns:
- Boolean containing true in case of a yearly keyword
-
isGroup
public boolean isGroup()Description copied from class:CalendarKeywordReturnstrueif this is a group keyword.- Specified by:
isGroupin classCalendarKeyword- Returns:
- Boolean containing true in case of a group keyword
-
isRoll
public boolean isRoll()Description copied from class:CalendarKeywordReturnstrueif this is a roll keyword.- Specified by:
isRollin classCalendarKeyword- Returns:
- Boolean containing true in case of a roll keyword
-
save
Description copied from class:CalendarKeywordSaves the keyword under the specified parent element- Specified by:
savein classCalendarKeyword- Parameters:
doc- XML Documentparent- Parent element
-