Package com.uc4.api.objects
Class YearlyCalendarKeyword
- java.lang.Object
-
- com.uc4.api.objects.CalendarKeyword
-
- com.uc4.api.objects.YearlyCalendarKeyword
-
public class YearlyCalendarKeyword extends CalendarKeyword
This class represents a yearly Calendar Keyword.
-
-
Constructor Summary
Constructors Modifier Constructor Description YearlyCalendarKeyword(UC4ObjectName name)Constructs a newYearlyCalendarKeyword.YearlyCalendarKeyword(UC4ObjectName name, int nYear, int startWithYear)Constructs a newYearlyCalendarKeyword.protectedYearlyCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDate(DateTime date)Adds a date to the selected dates.DateTimegetIntervalEndDate()Returns the end date of the interval.intgetIntervalEveryDay()Returns the interval in days.DateTimegetIntervalStartDate()Returns the start date of the interval.intgetNYear()Returns the interval in years.intgetStartYear()Returns the start year for the interval.booleanhasDefinedInterval()Returnstrueif 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.booleanisIntervalBeginOfYear()Returnstrueif the beginning of the year is set for the interval.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.voidremoveAllDates()Removes all selected dates.booleanremoveDate(DateTime date)Removes the specified date from the selected dates.protected voidsave(com.uc4.util.XMLDocument doc, org.w3c.dom.Element parent)Saves the keyword under the specified parent elementjava.util.Iterator<DateTime>selectedDates()Returns an iterator overDateTime.voidselectOnDefinedCalendarDays()If 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 Detail
-
YearlyCalendarKeyword
protected YearlyCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
YearlyCalendarKeyword
public YearlyCalendarKeyword(UC4ObjectName name, int nYear, int startWithYear)
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
public YearlyCalendarKeyword(UC4ObjectName name)
Constructs a newYearlyCalendarKeyword. The interval is set to 1 starting with the current year.- Parameters:
name- Name of the calendar keyword
-
-
Method Detail
-
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
public java.util.Iterator<DateTime> 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
public void addDate(DateTime date)
Adds a date to the selected dates.- Parameters:
date- Date
-
removeDate
public boolean removeDate(DateTime date)
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
public void inDefinedInterval(int everyNday, boolean beginOfYear, DateTime start, DateTime end)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
public DateTime 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
public DateTime 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
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
-
-