public class IntervalTo extends java.lang.Object implements ScheduleResult
END_OF_TIME, START_OF_TIME
Constructor and Description |
---|
IntervalTo(java.util.Date on)
Create a point interval.
|
IntervalTo(java.util.Date from,
java.util.Date upTo)
Create an interval up to the to Date.
|
IntervalTo(Interval interval)
Create an copy of the given Interval.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Test if two intervals are equivalent.
|
protected java.util.Date |
getEndDate()
Get the to date of the interval.
|
java.util.Date |
getFromDate()
Get the from date of the interval.
|
java.util.Date |
getToDate()
Get the upTo date which is a millisecond after the
inclusive to date.
|
java.util.Date |
getUseNext()
For recurring schedules this property provide the date that should be used
for the next call to
Schedule.nextDue(ScheduleContext) by using
the ScheduleContext.move(Date) method. |
int |
hashCode()
Crude implementation of hashCode, so intervals could
be stored in HashSets.
|
boolean |
isBefore(org.oddjob.schedules.IntervalBase other)
Test if this interval is before the other interval.
|
boolean |
isPast(org.oddjob.schedules.IntervalBase other)
Test if this interval is past the other interval.
|
boolean |
isPoint()
Is this interval really a point in time, not an interval.
|
Interval |
limit(Interval limit)
Provide an interval which is the result of this Limit
being limited by the given interval.
|
java.lang.String |
toString()
Return a string representation of this interval.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFromDate
public IntervalTo(java.util.Date on)
on
- public IntervalTo(java.util.Date from, java.util.Date upTo)
from
- upTo
- public IntervalTo(Interval interval)
interval
- public java.util.Date getToDate()
public Interval limit(Interval limit)
Results are determined as follows.
other
- The other interval. may be null.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
Intervals are equivalent if there start and end times are the same.
equals
in class java.lang.Object
other
- The interval to test against.public java.lang.String toString()
public java.util.Date getUseNext()
ScheduleResult
Schedule.nextDue(ScheduleContext)
by using
the ScheduleContext.move(Date)
method. For most schedules this
date will be identical to the Interval.getToDate()
but for some
schedules such AfterSchedule
this will not be the case.getUseNext
in interface ScheduleResult
public java.util.Date getFromDate()
protected java.util.Date getEndDate()
public boolean isBefore(org.oddjob.schedules.IntervalBase other)
This happens when this from time is less than other from time.
this: ---- or ---- other: ---- ----
other
- public boolean isPast(org.oddjob.schedules.IntervalBase other)
This happens when the this from time is greater than the other ones to time.
this: ---- other: ----
public boolean isPoint()