org.opensync.schedule
Class SchedulerEntry

java.lang.Object
  extended byorg.opensync.schedule.SchedulerEntry
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class SchedulerEntry
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

This class reprsents a entry of the scheduler

Author:
SOFTMED
See Also:
Serialized Form

Field Summary
protected  java.util.Date date
          The date
protected  int dayOfMonth
          The day of month
protected  int dayOfWeek
          The day of week
protected  int hour
          The hour
protected  int minute
          The minute
 
Constructor Summary
SchedulerEntry(java.lang.String name, java.util.Date date, java.lang.Runnable runnable)
          Construct a schedule entry
SchedulerEntry(java.lang.String name, int day, int hour, int minute, java.lang.Runnable runnable, boolean ofWeek)
          Construct a schedule entry
SchedulerEntry(java.lang.String name, java.lang.Runnable runnable)
          Construct a schedule entry
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare the date of the entry
 java.util.Date getDate()
          Get the date
 int getDayOfMonth()
          Get the day of month
 int getDayOfWeek()
          Get the day of week
 int getHour()
          Get the hour
 int getMinute()
          Get the minute
 java.lang.String getName()
          Get the name of the entry
 java.lang.Runnable getRunnable()
          Get the runnable object
 long getTime()
          Get the time
 int hashCode()
           
protected  boolean isPastTime(int hour, int minute)
          Test if the time is a past time
 boolean isTimeSchedule()
          Is a time scheduling
 void setNextTime()
          Set next time to start the runnable object
 java.lang.String toString()
          Use for debug only
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

date

protected java.util.Date date
The date


hour

protected int hour
The hour


minute

protected int minute
The minute


dayOfWeek

protected int dayOfWeek
The day of week


dayOfMonth

protected int dayOfMonth
The day of month

Constructor Detail

SchedulerEntry

public SchedulerEntry(java.lang.String name,
                      java.util.Date date,
                      java.lang.Runnable runnable)
Construct a schedule entry

Parameters:
name - the name of the entry
date - the date to start the runnable
runnable - the runnable object to start

SchedulerEntry

public SchedulerEntry(java.lang.String name,
                      java.lang.Runnable runnable)
Construct a schedule entry

Parameters:
name - the name of the entry
runnable - the runnable object to start

SchedulerEntry

public SchedulerEntry(java.lang.String name,
                      int day,
                      int hour,
                      int minute,
                      java.lang.Runnable runnable,
                      boolean ofWeek)
Construct a schedule entry

Parameters:
name - the name of the entry
day -
hour -
minute -
runnable - the runnable object to start
ofWeek -
Method Detail

getDate

public java.util.Date getDate()
Get the date


toString

public java.lang.String toString()
Use for debug only


compareTo

public int compareTo(java.lang.Object o)
Compare the date of the entry

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the entry to compare

getHour

public int getHour()
Get the hour


getMinute

public int getMinute()
Get the minute


getDayOfWeek

public int getDayOfWeek()
Get the day of week


getTime

public long getTime()
Get the time


getDayOfMonth

public int getDayOfMonth()
Get the day of month


getRunnable

public java.lang.Runnable getRunnable()
Get the runnable object


hashCode

public int hashCode()

setNextTime

public void setNextTime()
Set next time to start the runnable object


isPastTime

protected boolean isPastTime(int hour,
                             int minute)
Test if the time is a past time

Parameters:
hour - the hout to test
minute -

isTimeSchedule

public boolean isTimeSchedule()
Is a time scheduling


getName

public java.lang.String getName()
Get the name of the entry



Copyright © 2004 sourceforge. All Rights Reserved.