public class ScheduleContext
extends java.lang.Object
| Constructor and Description |
|---|
ScheduleContext(java.util.Date now)
Constructor for a new context with a date to evaluate from, and using
the default time zone.
|
ScheduleContext(java.util.Date use,
java.util.TimeZone timeZone)
Constructor for a new context with a date to evaluate from, and a
time zone to evaluate the schedule with.
|
ScheduleContext(java.util.Date now,
java.util.TimeZone timeZone,
java.util.Map<java.lang.Object,java.lang.Object> data)
Constructor with a data map.
|
ScheduleContext(java.util.Date now,
java.util.TimeZone timeZone,
java.util.Map<java.lang.Object,java.lang.Object> data,
Interval parentInterval)
Constructor with a data map.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getData(java.lang.Object key)
Get data back from the context data map.
|
java.util.Date |
getDate()
Get the date to evaluate the schedule with.
|
Interval |
getParentInterval()
The parent interval will be defined by a schedule and
passed to it's child.
|
java.util.TimeZone |
getTimeZone()
Get the time zone to evaluate the schdule in.
|
ScheduleContext |
move(java.util.Date date)
Moves the existing context to one for a new date.
|
void |
putData(java.lang.Object key,
java.lang.Object value)
Add data to the context data map.
|
ScheduleContext |
spawn(java.util.Date date,
Interval parentInterval)
Create a new context from the existing one for a new
parent interval and with an new context date.
|
ScheduleContext |
spawn(Interval parentInterval)
Create a new context with the existing time zone and data map,
but a new parent interval.
|
java.lang.String |
toString() |
public ScheduleContext(java.util.Date now)
now - The date to evaluate from.public ScheduleContext(java.util.Date use,
java.util.TimeZone timeZone)
use - The date to evaluate from.timeZone - The time zone.public ScheduleContext(java.util.Date now,
java.util.TimeZone timeZone,
java.util.Map<java.lang.Object,java.lang.Object> data)
now - The date to evaluate from. A null date is allowed
and means the schedule will never be due.timeZone - The time zone.data - The data map.public ScheduleContext(java.util.Date now,
java.util.TimeZone timeZone,
java.util.Map<java.lang.Object,java.lang.Object> data,
Interval parentInterval)
now - The date to evaluate from. A null date is allowed
and means the schedule will never be due.timeZone - The time zone.data - The data map.public java.util.Date getDate()
public java.util.TimeZone getTimeZone()
public void putData(java.lang.Object key,
java.lang.Object value)
key - The key.value - The value.public java.lang.Object getData(java.lang.Object key)
key - The key.public Interval getParentInterval()
public ScheduleContext spawn(Interval parentInterval)
parentInterval - The new constraining parent interval.public ScheduleContext spawn(java.util.Date date, Interval parentInterval)
date - The next date.parentInterval - The new constraining parent interval.public ScheduleContext move(java.util.Date date)
date - The date to shift the context to.public java.lang.String toString()
toString in class java.lang.Object