public class Schedule
extends java.lang.Object
implements java.lang.Cloneable
A Schedule has a name, a list of inclusion periods and a list of exclusion periods. A Schedule is in-schedule if at least one of its inclusion periods is in-schedule and none of its exclusion periods are in-schedule. If a Schedule does not have any inclusion period, then it is in-schedule if none of its exclusion periods are in-schedule. If a Schedule does not have any inclusion period or exclusion period, then it is out-of-schedule.
The inclusion periods and exclusion periods may contain Period or PeriodGroupReference objects.
Constructor and Description |
---|
Schedule(java.lang.String name)
Creates a schedule with the specified name.
|
Schedule(java.lang.String name,
Scheduleable[] inclusionPeriods,
Scheduleable[] exclusionPeriods)
Deprecated.
|
Schedule(java.lang.String name,
java.util.Vector inclusionPeriods,
java.util.Vector exclusionPeriods)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addExclusionPeriod(Scheduleable period)
Adds an period to existing a list of exclusion periods.
|
void |
addInclusionPeriod(Scheduleable period)
Adds an inclusion periods to existing a list of inclusion periods.
|
java.lang.Object |
clone()
Returns a copy of this Schedule.
|
boolean |
equals(java.lang.Object o)
Compares with the specified schedule for equality.
|
Scheduleable[] |
getExclusionPeriods()
Returns all exclusion periods in this Schedule.
|
java.util.Vector |
getExclusionPeriodsAsVector()
Deprecated.
|
Scheduleable[] |
getInclusionPeriods()
Returns all inclusion periods in this Schedule.
|
java.util.Vector |
getInclusionPeriodsAsVector()
Deprecated.
|
java.lang.String |
getName()
Returns the name of the schedule.
|
long |
getSecondTillNextScheduleChange()
Returns seconds until next schedule change.
|
java.lang.String |
getTimeZone()
Returns the TimeZone for this schedule.
|
boolean |
inSchedule(java.util.Date date)
Checks to see if the schedule is in-schedule using the specified date.
|
boolean |
isUsingPeriodGroup(java.lang.String periodGroupName)
Checks if the specified PeriodGroup is used by this schedules.
|
void |
removeExclusionPeriod(Scheduleable period)
Removes an period from existing a list of exclusion periods.
|
void |
removeInclusionPeriod(Scheduleable period)
Removes an period from existing a list of inclusion periods.
|
void |
setExclusionPeriods(java.util.Vector periods)
Deprecated.
|
void |
setInclusionPeriods(java.util.Vector periods)
Deprecated.
|
void |
setName(java.lang.String name)
Sets the name of the Schedule.
|
void |
setTimeZone(java.lang.String timeZone)
Sets the timezone of the Schedule.
|
java.lang.String |
toString()
Returns a string representation of the Schedule object.
|
public Schedule(java.lang.String name)
name
- the schedule namepublic Schedule(java.lang.String name, Scheduleable[] inclusionPeriods, Scheduleable[] exclusionPeriods)
name
- the schedule nameinclusionPeriods
- a list of inclusion Period or PeriodGroupReferenceexclusionPeriods
- a list of exclusion Period or PeriodGroupReferencejava.lang.IllegalArgumentException
- if name, inclusionPeriods or inclusionPeriods is nullpublic Schedule(java.lang.String name, java.util.Vector inclusionPeriods, java.util.Vector exclusionPeriods)
name
- the schedule nameinclusionPeriods
- a list of inclusion Period or PeriodGroupReferenceexclusionPeriods
- a list of exclusion Period or PeriodGroupReferencejava.lang.IllegalArgumentException
- if name, inclusionPeriods or inclusionPeriods is nullpublic boolean inSchedule(java.util.Date date)
date
- date to be checked.public long getSecondTillNextScheduleChange()
public void setName(java.lang.String name)
java.lang.IllegalArgumentException
- if name is nullpublic java.lang.String getName()
public void setTimeZone(java.lang.String timeZone)
Note: In 4.7, timezone can be set to null. If timezone is null, local timezone is used for the schedule.
public java.lang.String getTimeZone()
public void setInclusionPeriods(java.util.Vector periods)
public Scheduleable[] getInclusionPeriods()
public java.util.Vector getInclusionPeriodsAsVector()
public void setExclusionPeriods(java.util.Vector periods)
public Scheduleable[] getExclusionPeriods()
public java.util.Vector getExclusionPeriodsAsVector()
public void addInclusionPeriod(Scheduleable period)
period
- Period or PeriodGroupReference to be added.java.lang.IllegalArgumentException
- if period is nullpublic void addExclusionPeriod(Scheduleable period)
period
- Period or PeriodGroupReference to be added.java.lang.IllegalArgumentException
- if period is nullpublic void removeInclusionPeriod(Scheduleable period)
public void removeExclusionPeriod(Scheduleable period)
public boolean isUsingPeriodGroup(java.lang.String periodGroupName)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the Schedule to be compared.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.