Package com.uc4.api.objects
Class YearlyCalendarKeyword
java.lang.Object
com.uc4.api.objects.CalendarKeyword
com.uc4.api.objects.YearlyCalendarKeyword
This class represents a yearly Calendar Keyword.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a newYearlyCalendarKeyword
.YearlyCalendarKeyword
(UC4ObjectName name, int nYear, int startWithYear) Constructs a newYearlyCalendarKeyword
.protected
YearlyCalendarKeyword
(Element keyword, String string) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a date to the selected dates.Returns the end date of the interval.int
Returns the interval in days.Returns the start date of the interval.int
getNYear()
Returns the interval in years.int
Returns the start year for the interval.boolean
Returnstrue
if this yearly keyword has a defined interval.void
inDefinedInterval
(int everyNday, boolean beginOfYear, DateTime start, DateTime end) Defines an interval for this yearly keyword.boolean
isGroup()
Returnstrue
if this is a group keyword.boolean
Returnstrue
if the beginning of the year is set for the interval.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.void
Removes all selected dates.boolean
removeDate
(DateTime date) Removes the specified date from the selected dates.protected void
Saves the keyword under the specified parent elementReturns an iterator overDateTime
.void
If this method is called the selected calendar days are used.void
setNYear
(int nYear) Sets the interval in years.void
setStartYear
(int startYear) Sets the start year for the 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
-
YearlyCalendarKeyword
-
YearlyCalendarKeyword
Constructs a newYearlyCalendarKeyword
.- Parameters:
name
- Name of the calendar keywordnYear
- Every n year, integer between 1 and 1000startWithYear
- Year to start with, integer between 1 and 3000
-
YearlyCalendarKeyword
Constructs a newYearlyCalendarKeyword
. The interval is set to 1 starting with the current year.- Parameters:
name
- Name of the calendar keyword
-
-
Method Details
-
selectOnDefinedCalendarDays
public void selectOnDefinedCalendarDays()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
). -
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 overDateTime
. This iterator can be used to read the selected dates and remove dates using the remove method of theIterator
.- Returns:
- Iterator over DateTime
-
addDate
Adds a date to the selected dates.- Parameters:
date
- Date
-
removeDate
Removes the specified date from the selected dates.- Parameters:
date
- Date- Returns:
- True if and only if the date was successfully removed
-
removeAllDates
public void removeAllDates()Removes all selected dates. -
inDefinedInterval
Defines an interval for this yearly keyword.- Parameters:
everyNday
- Every n day, integer between 1 and 365beginOfYear
- Direction for day counting, true means that every n day from the beginning of the year is countedstart
- Start dateend
- End date
-
isIntervalBeginOfYear
public boolean isIntervalBeginOfYear()Returnstrue
if the beginning of the year is set for the interval.- Returns:
- Boolean which contains false if the counting starts at the end of the year
-
getIntervalEndDate
Returns the end date of the interval.- Returns:
- End date of the interval
-
getIntervalEveryDay
public int getIntervalEveryDay()Returns the interval in days.- Returns:
- Interval in days
-
getIntervalStartDate
Returns the start date of the interval.- Returns:
- Start date of the interval
-
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
-
getNYear
public int getNYear()Returns the interval in years.- Returns:
- Integer containg the inverval in years
-
setNYear
public void setNYear(int nYear) Sets the interval in years.- Parameters:
nYear
- Integer containg the inverval in years
-
getStartYear
public int getStartYear()Returns the start year for the interval.- Returns:
- Integer containg the start year
-
setStartYear
public void setStartYear(int startYear) Sets the start year for the interval.- Parameters:
startYear
- Integer containg the start year
-
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
-