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
.protected
MonthlyCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDate(java.lang.Integer day)
Adds a day to the selected days.int
getEndMonth()
Returns the number of the end month of the monthly interval.java.lang.Integer
getIntervalEndDay()
Returns the end day of the interval.int
getIntervalEveryDay()
Returns the interval in days.java.lang.Integer
getIntervalStartDay()
Returns the start day of the interval.int
getNMonth()
Returns the period in month.int
getStartMonth()
Returns the number of the start month of the monthly interval.boolean
hasDefinedInterval()
Returnstrue
if this yearly keyword has a defined interval.void
inDefinedInterval(int everyNday, boolean beginOfMonth, java.lang.Integer start, java.lang.Integer end)
Defines an interval for this monthly keyword.boolean
isGroup()
Returnstrue
if this is a group keyword.boolean
isIntervalBeginOfMonth()
Returns the direction for counting the days.boolean
isMonthly()
Returnstrue
if this is a monthly keyword.boolean
isOnDefinedCalendarDays()
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(java.lang.Integer day)
Removes the specified day from the selected days.protected void
save(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
.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 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()
Returnstrue
if 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()
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
protected void save(com.uc4.util.XMLDocument doc, org.w3c.dom.Element parent)
Description copied from class:CalendarKeyword
Saves the keyword under the specified parent element- Specified by:
save
in classCalendarKeyword
- Parameters:
doc
- XML Documentparent
- Parent element
-
-