fr.emn.spiraclock
Class Schedule

java.lang.Object
  extended by fr.emn.spiraclock.Schedule
Direct Known Subclasses:
EMNBusSchedule, ExampleSchedule, OutlookSchedule, SalatSchedule, ShuttleUMSchedule, TestSchedule, VCalendarSchedule, XMLSchedule

public abstract class Schedule
extends java.lang.Object

A Schedule class optimized for extra-fast appointment retreiving. This class is NOT thread-safe.


Field Summary
(package private)  Appointment app
           
(package private)  Appointment[][][] appointments
           
(package private)  ATime baseday
           
(package private)  java.util.Hashtable cache
           
(package private)  boolean cacheEnabled
           
(package private)  int common0
           
(package private)  int common1
           
(package private)  int currentQueryId
           
static java.lang.String errorMessage
           
(package private)  int hour_index
           
(package private)  int hour_max
           
(package private)  int hour_min
           
(package private)  boolean intervalSet
           
(package private)  boolean loaded
           
(package private)  int mn_max
           
(package private)  int mn_min
           
(package private)  int nb_index
           
(package private)  int rday_index
           
(package private)  int rday0
           
(package private)  int rday1
           
(package private)  java.util.Vector res
           
(package private)  int tmn0
           
(package private)  int tmn1
           
(package private)  JSpiraclock view
           
 
Constructor Summary
Schedule()
          Constructor
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
           
abstract  void beforeClosing()
          Subclass this method to set all schedule needed operations before application close
 void clearCache()
          Clears appointments cache (forces to recall getDayAppointments()).
protected  void fireStateChanged()
           
 void firstAppointment()
          Used by JSpiraclock.
 Appointment[] getAppointments(int relativeDay, int totalMinutes, int interval)
          (slow) Returns all appointements in current time interval containing the given time +/- 1mn.
 ATime getBaseDay()
          Used by JSpiraclock.
abstract  Appointment[] getDayAppointments(ATime day)
          Subclass this method to return all appointments in the given day.
abstract  java.lang.String getName()
          Subclass this method to return schedule name.
abstract  java.util.Hashtable getProperties()
          Subclass this method to return all schedule properties property name (String) is the hash key and the value is an object
 JSpiraclock getView()
           
 void installPopupCommands(javax.swing.JPopupMenu popup)
          Gives the Schedule an opportunity to install its own popup menu commands on the spiraclock popup menu.
 boolean isLoadingNeeded(int relativeDay0, int totalMinutes0, int relativeDay1, int totalMinutes1)
          Used by JSpiraclock.
 Appointment nextAppointment()
          Used by JSpiraclock.
abstract  void reload()
          Subclass this method to reload all your data.
protected  Appointment[][] retreive(int relDay)
           
 void setBaseDay(ATime baseday)
          Used by JSpiraclock.
 void setInterval(int relativeDay0, int totalMinutes0, int relativeDay1, int totalMinutes1)
          Used by JSpiraclock.
abstract  void setProperties(java.util.Hashtable props)
          Subclass this method to set all schedule dependant properties given in parameter
(package private)  void setView(JSpiraclock clock)
          Pending: Replace by addView / removeView to manage multiple views
 void updateView()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheEnabled

boolean cacheEnabled

errorMessage

public static java.lang.String errorMessage

appointments

Appointment[][][] appointments

baseday

ATime baseday

cache

java.util.Hashtable cache

rday0

int rday0

rday1

int rday1

tmn0

int tmn0

tmn1

int tmn1

loaded

boolean loaded

currentQueryId

int currentQueryId

rday_index

int rday_index

hour_index

int hour_index

nb_index

int nb_index

hour_max

int hour_max

hour_min

int hour_min

mn_min

int mn_min

mn_max

int mn_max

common0

int common0

common1

int common1

app

Appointment app

res

java.util.Vector res

intervalSet

boolean intervalSet

view

JSpiraclock view
Constructor Detail

Schedule

public Schedule()
Constructor

Method Detail

getName

public abstract java.lang.String getName()
Subclass this method to return schedule name.


getDayAppointments

public abstract Appointment[] getDayAppointments(ATime day)
Subclass this method to return all appointments in the given day. Appointments that does not start & end the same day are NOT returned. (This method does not need to be fast).


reload

public abstract void reload()
Subclass this method to reload all your data.


getProperties

public abstract java.util.Hashtable getProperties()
Subclass this method to return all schedule properties property name (String) is the hash key and the value is an object


setProperties

public abstract void setProperties(java.util.Hashtable props)
Subclass this method to set all schedule dependant properties given in parameter


beforeClosing

public abstract void beforeClosing()
Subclass this method to set all schedule needed operations before application close


installPopupCommands

public void installPopupCommands(javax.swing.JPopupMenu popup)
Gives the Schedule an opportunity to install its own popup menu commands on the spiraclock popup menu. Subclass this method if you want your schedule to handle user commands.


clearCache

public void clearCache()
Clears appointments cache (forces to recall getDayAppointments()).


setBaseDay

public void setBaseDay(ATime baseday)
Used by JSpiraclock.


getBaseDay

public ATime getBaseDay()
Used by JSpiraclock.


isLoadingNeeded

public boolean isLoadingNeeded(int relativeDay0,
                               int totalMinutes0,
                               int relativeDay1,
                               int totalMinutes1)
Used by JSpiraclock.


setInterval

public void setInterval(int relativeDay0,
                        int totalMinutes0,
                        int relativeDay1,
                        int totalMinutes1)
Used by JSpiraclock. Sets time interval before retreiveing appointments. totalMinutes = hour*60 + minutes.


firstAppointment

public void firstAppointment()
Used by JSpiraclock.


nextAppointment

public Appointment nextAppointment()
Used by JSpiraclock. This is the extra-fast appointement retreiving method.


getAppointments

public Appointment[] getAppointments(int relativeDay,
                                     int totalMinutes,
                                     int interval)
(slow) Returns all appointements in current time interval containing the given time +/- 1mn.


retreive

protected Appointment[][] retreive(int relDay)

setView

void setView(JSpiraclock clock)
Pending: Replace by addView / removeView to manage multiple views


updateView

public void updateView()

getView

public JSpiraclock getView()

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)

fireStateChanged

protected void fireStateChanged()