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 newStaticCalendarKeyword
using the specified name and date range.protected
StaticCalendarKeyword(org.w3c.dom.Element keyword, java.lang.String string)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(DateTime date)
Adds a new date to this static calendar keyword.void
clear()
Removes all dates from this static calendar keyword.DateTime
getValidFrom()
Returns the start date of the validity period.DateTime
getValidTo()
Returns the end date of the validity period.boolean
isGroup()
Returnstrue
if this is a group keyword.boolean
isMonthly()
Returnstrue
if this is a monthly keyword.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.java.util.Iterator<DateTime>
iterator()
Returns an iterator overDateTime
.boolean
remove(DateTime date)
Removes the specified date from this static calendar keyword.protected void
save(com.uc4.util.XMLDocument doc, org.w3c.dom.Element parent)
Saves the keyword under the specified parent elementvoid
setValidFrom(DateTime validFrom)
Sets the start date of the validity period.void
setValidTo(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 newStaticCalendarKeyword
using 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:
iterator
in 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: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
-
-