org.oddjob.schedules
Class SimpleScheduleResult

java.lang.Object
  extended by org.oddjob.schedules.SimpleScheduleResult
All Implemented Interfaces:
Serializable, Interval, ScheduleResult

public class SimpleScheduleResult
extends Object
implements ScheduleResult, Serializable

A simple ScheduleResult

See Also:
Serialized Form
Author:
rob

Field Summary
 
Fields inherited from interface org.oddjob.schedules.Interval
END_OF_TIME, START_OF_TIME
 
Constructor Summary
SimpleScheduleResult(Interval interval)
           
SimpleScheduleResult(Interval interval, Date useNext)
           
 
Method Summary
 boolean equals(Object other)
          Test if two intervals are equivalent.
 Date getFromDate()
          The date the interval is from which includes this date.
 Date getToDate()
          The date the interval is up to but excluding.
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleScheduleResult

public SimpleScheduleResult(Interval interval)

SimpleScheduleResult

public SimpleScheduleResult(Interval interval,
                            Date useNext)
Method Detail

getFromDate

public Date getFromDate()
Description copied from interface: Interval
The date the interval is from which includes this date.

Specified by:
getFromDate in interface Interval
Returns:
Never null and alway less than the to date.

getToDate

public Date getToDate()
Description copied from interface: Interval
The date the interval is up to but excluding.

Specified by:
getToDate in interface Interval
Returns:
A date. Never and always greater than the from date.

getUseNext

public Date getUseNext()
Description copied from interface: ScheduleResult
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. For most schedules this date will be identical to the Interval.getToDate() but for some schedules such AfterSchedule this will not be the case.

Specified by:
getUseNext in interface ScheduleResult
Returns:
A date. May be null to indicate there is no other next due for this schedule..

hashCode

public int hashCode()
Crude implementation of hashCode, so intervals could be stored in HashSets.

Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Test if two intervals are equivalent.

Intervals are equivalent if there start and end times are the same.

Overrides:
equals in class Object
Parameters:
other - The interval to test against.
Returns:
true if they are equal.

toString

public String toString()
Overrides:
toString in class Object