atg.service.scheduler
Class AbsoluteSchedule

java.lang.Object
  extended by atg.service.scheduler.AbsoluteSchedule
All Implemented Interfaces:
Schedule, java.io.Serializable
Direct Known Subclasses:
RelativeSchedule

public class AbsoluteSchedule
extends java.lang.Object
implements Schedule, java.io.Serializable

This implementation of Schedule represents a Schedule for an job that occurs once, at a specific time.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
AbsoluteSchedule(long pJobTime)
          Constructs a new AbsoluteSchedule for a job that will occur at the specified time.
AbsoluteSchedule(java.lang.String pValue, java.util.Locale pLocale)
          Attempts to parse the String parameter pValue into an absolute schedule.
 
Method Summary
 boolean equals(java.lang.Object pObject)
          Returns true if the given object is an AbsoluteSchedule with the same job time as this schedule.
 long getNextJobTime(long pLastOccurrenceTime)
          Returns the next time that the job Scheduled by this will take place.
static java.util.ResourceBundle getResources(java.util.Locale pLocale)
           
 int hashCode()
          Returns a hash code value for this object.
 boolean isRepeating()
          Returns true if this is a repeating job, false if this is a one-shot job.
 boolean mustKnowFirstTime()
          If true, then the first time getNextJobTime is called it will be called with -1.
 java.lang.String scheduleString()
          Returns a Parseable representation of this Schedule.
 java.lang.String scheduleString(java.util.Locale pLocale)
          Returns a Parseable representation of this Schedule.
 java.lang.String toString()
          Returns a String value of this
 java.lang.String toString(java.util.Locale pLocale)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

AbsoluteSchedule

public AbsoluteSchedule(java.lang.String pValue,
                        java.util.Locale pLocale)
                 throws java.lang.IllegalArgumentException
Attempts to parse the String parameter pValue into an absolute schedule.

Parameters:
pValue - a String value
pLocale - a Locale value
Throws:
java.lang.IllegalArgumentException - if the string can not be parsed

AbsoluteSchedule

public AbsoluteSchedule(long pJobTime)
Constructs a new AbsoluteSchedule for a job that will occur at the specified time.

Method Detail

getResources

public static java.util.ResourceBundle getResources(java.util.Locale pLocale)

getNextJobTime

public long getNextJobTime(long pLastOccurrenceTime)
Returns the next time that the job Scheduled by this will take place.

Specified by:
getNextJobTime in interface Schedule
Parameters:
pLastOccurrenceTime - the last time the job occurred, or -1 if it has not yet occurred.
Returns:
the next time that the job will occur, or -1 if the job's next time could not be calculated.

mustKnowFirstTime

public boolean mustKnowFirstTime()
If true, then the first time getNextJobTime is called it will be called with -1. Otherwise, the first time getNextJobTime is called it will be called with the current time.

Specified by:
mustKnowFirstTime in interface Schedule

isRepeating

public boolean isRepeating()
Returns true if this is a repeating job, false if this is a one-shot job.

Specified by:
isRepeating in interface Schedule

toString

public java.lang.String toString()
Returns a String value of this

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.util.Locale pLocale)

scheduleString

public java.lang.String scheduleString()
Description copied from interface: Schedule
Returns a Parseable representation of this Schedule.

Specified by:
scheduleString in interface Schedule

scheduleString

public java.lang.String scheduleString(java.util.Locale pLocale)
Returns a Parseable representation of this Schedule.

Specified by:
scheduleString in interface Schedule

equals

public boolean equals(java.lang.Object pObject)
Returns true if the given object is an AbsoluteSchedule with the same job time as this schedule.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class java.lang.Object