Package com.uc4.api.objects
Class MonthlyCalendarKeyword
- java.lang.Object
-
- com.uc4.api.objects.CalendarKeyword
-
- com.uc4.api.objects.MonthlyCalendarKeyword
-
public class MonthlyCalendarKeyword extends CalendarKeyword
This class represents a monthly calendar keyword.
-
-
Constructor Summary
Constructors Modifier Constructor Description MonthlyCalendarKeyword(UC4ObjectName name)Constructs a newMonthlyCalendarKeyword.MonthlyCalendarKeyword(UC4ObjectName name, int nMonth, int startMonth, int endMonth)Constructs a newMonthlyCalendarKeyword.protectedMonthlyCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDate(java.lang.Integer day)Adds a day to the selected days.intgetEndMonth()Returns the number of the end month of the monthly interval.java.lang.IntegergetIntervalEndDay()Returns the end day of the interval.intgetIntervalEveryDay()Returns the interval in days.java.lang.IntegergetIntervalStartDay()Returns the start day of the interval.intgetNMonth()Returns the period in month.intgetStartMonth()Returns the number of the start month of the monthly interval.booleanhasDefinedInterval()Returnstrueif this yearly keyword has a defined interval.voidinDefinedInterval(int everyNday, boolean beginOfMonth, java.lang.Integer start, java.lang.Integer end)Defines an interval for this monthly keyword.booleanisGroup()Returnstrueif this is a group keyword.booleanisIntervalBeginOfMonth()Returns the direction for counting the days.booleanisMonthly()Returnstrueif this is a monthly keyword.booleanisOnDefinedCalendarDays()Returnstrueif 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(java.lang.Integer day)Removes the specified day from the selected days.protected voidsave(com.uc4.util.XMLDocument doc, org.w3c.dom.Element parent)Saves the keyword under the specified parent elementjava.util.Iterator<java.lang.Integer>selectedDates()Returns 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 Detail
-
MonthlyCalendarKeyword
protected MonthlyCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
MonthlyCalendarKeyword
public MonthlyCalendarKeyword(UC4ObjectName name, int nMonth, int startMonth, int endMonth)
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
public MonthlyCalendarKeyword(UC4ObjectName name)
Constructs a newMonthlyCalendarKeyword. Every 1 Month starting with month 1 and ending with 12 is selected.- Parameters:
name- Name of the calendar keyword
-
-
Method Detail
-
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
public java.util.Iterator<java.lang.Integer> 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
public void addDate(java.lang.Integer day)
Adds a day to the selected days.- Parameters:
day- Day
-
removeDate
public boolean removeDate(java.lang.Integer day)
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
public void inDefinedInterval(int everyNday, boolean beginOfMonth, java.lang.Integer start, java.lang.Integer end)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
public java.lang.Integer 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
public java.lang.Integer 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
protected void save(com.uc4.util.XMLDocument doc, org.w3c.dom.Element parent)Description copied from class:CalendarKeywordSaves the keyword under the specified parent element- Specified by:
savein classCalendarKeyword- Parameters:
doc- XML Documentparent- Parent element
-
-