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.protectedYearlyCalendarKeyword(Element keyword, String string) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a date to the selected dates.Returns the end date of the interval.intReturns the interval in days.Returns the start date of the interval.intgetNYear()Returns the interval in years.intReturns the start year for the interval.booleanReturnstrueif this yearly keyword has a defined interval.voidinDefinedInterval(int everyNday, boolean beginOfYear, DateTime start, DateTime end) Defines an interval for this yearly keyword.booleanisGroup()Returnstrueif this is a group keyword.booleanReturnstrueif the beginning of the year is set for the interval.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.voidRemoves all selected dates.booleanremoveDate(DateTime date) Removes the specified date from the selected dates.protected voidSaves the keyword under the specified parent elementReturns an iterator overDateTime.voidIf this method is called the selected calendar days are used.voidsetNYear(int nYear) Sets the interval in years.voidsetStartYear(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()Returnstrueif 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()Returnstrueif 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()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
-
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: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
-