Package com.uc4.api.objects
Class StaticCalendarKeyword
- java.lang.Object
-
- com.uc4.api.objects.CalendarKeyword
-
- com.uc4.api.objects.StaticCalendarKeyword
-
- All Implemented Interfaces:
java.lang.Iterable<DateTime>
public class StaticCalendarKeyword extends CalendarKeyword implements java.lang.Iterable<DateTime>
This class represents a static calendar keyword.
-
-
Constructor Summary
Constructors Modifier Constructor Description StaticCalendarKeyword(UC4ObjectName name, DateTime from, DateTime to)Constructs a newStaticCalendarKeywordusing the specified name and date range.protectedStaticCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(DateTime date)Adds a new date to this static calendar keyword.voidclear()Removes all dates from this static calendar keyword.DateTimegetValidFrom()Returns the start date of the validity period.DateTimegetValidTo()Returns the end date of the validity period.booleanisGroup()Returnstrueif this is a group keyword.booleanisMonthly()Returnstrueif this is a monthly keyword.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.java.util.Iterator<DateTime>iterator()Returns an iterator overDateTime.booleanremove(DateTime date)Removes the specified date from this static calendar keyword.protected voidsave(com.uc4.util.XMLDocument doc, org.w3c.dom.Element parent)Saves the keyword under the specified parent elementvoidsetValidFrom(DateTime validFrom)Sets the start date of the validity period.voidsetValidTo(DateTime validTo)Sets the end date of the validity period.-
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
-
StaticCalendarKeyword
public StaticCalendarKeyword(UC4ObjectName name, DateTime from, DateTime to)
Constructs a newStaticCalendarKeywordusing the specified name and date range.- Parameters:
name- Name of the Calendar Keywordfrom- Start date where the calendar keyword is validto- End date until the calendar keyword is valid
-
StaticCalendarKeyword
protected StaticCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
-
Method Detail
-
iterator
public java.util.Iterator<DateTime> iterator()
Returns an iterator overDateTime. This iterator can be used to read or delete dates in this static calendar keyword.- Specified by:
iteratorin interfacejava.lang.Iterable<DateTime>- Returns:
- Iterator over dates in this static calendar keyword
-
add
public void add(DateTime date)
Adds a new date to this static calendar keyword.- Parameters:
date- DateTime containing the Date that should be added
-
remove
public boolean remove(DateTime date)
Removes the specified date from this static calendar keyword.- Parameters:
date- DateTime which should be removed- Returns:
- True if and only if the date was removed successfully.
-
clear
public void clear()
Removes all dates from this static calendar keyword.
-
getValidFrom
public DateTime getValidFrom()
Returns the start date of the validity period.- Returns:
- DateTime containing the start date of the validity period
-
setValidFrom
public void setValidFrom(DateTime validFrom)
Sets the start date of the validity period.- Parameters:
validFrom- DateTime containing the start date of the validity period
-
getValidTo
public DateTime getValidTo()
Returns the end date of the validity period.- Returns:
- DateTime containing the end date of the validity period
-
setValidTo
public void setValidTo(DateTime validTo)
Sets the end date of the validity period.- Parameters:
validTo- DateTime containing the end date of the validity period
-
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
-
-