com.monad.homerun.action
Class Schedule

java.lang.Object
  extended by com.monad.homerun.base.DataObject
      extended by com.monad.homerun.action.Schedule
All Implemented Interfaces:
java.io.Serializable

public class Schedule
extends DataObject

The Schedule class holds an ordered list of schedule entries for a designated interval (currently, only a week). These entries currently include only time bindings, viz. actions set to start, run, or stop at a designated time.

See Also:
Serialized Form

Field Summary
static java.lang.String NO_NEXT_SCHEDULE
           
 
Constructor Summary
Schedule()
           
Schedule(Schedule schedule)
           
Schedule(java.lang.String schedName)
           
Schedule(java.lang.String schedName, int repeat, java.lang.String nextSched, TimeBinding[] entries)
           
 
Method Summary
 void addEntry(TimeBinding entry)
          Adds a time binding as an entry in the schedule
 TimeBinding[] getEntries()
          Returns all the schedule entries in a time-ordered array
 TimeBinding getEntry(int index)
          Returns a schedule entry at the passed index
 int getFirstIndexAt(short time)
           
 int getLength()
          Returns the number of minutes in the schedule
 java.lang.String getNextSchedule()
          Returns the name of the schedule that follows this one
 int getNumEntries()
          Returns the number of entries in the schedule
 int getRepeat()
          Returns the repetition count of the schedule
 void loadEntries(TimeBinding[] entries)
           
 void removeEntry(int index)
           
 void removeEntry(TimeBinding entry)
          Removes a time binding entry from the schedule
 void setNextSchedule(java.lang.String nextSched)
           
 void setRepeat(int repeat)
           
 
Methods inherited from class com.monad.homerun.base.DataObject
getCategory, getModificationTime, getName, getNote, setCategory, setModificationTime, setName, setNote
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_NEXT_SCHEDULE

public static final java.lang.String NO_NEXT_SCHEDULE
See Also:
Constant Field Values
Constructor Detail

Schedule

public Schedule()

Schedule

public Schedule(java.lang.String schedName)

Schedule

public Schedule(java.lang.String schedName,
                int repeat,
                java.lang.String nextSched,
                TimeBinding[] entries)

Schedule

public Schedule(Schedule schedule)
Method Detail

loadEntries

public void loadEntries(TimeBinding[] entries)

addEntry

public void addEntry(TimeBinding entry)
Adds a time binding as an entry in the schedule

Parameters:
entry - a time binding

removeEntry

public void removeEntry(TimeBinding entry)
Removes a time binding entry from the schedule

Parameters:
entry - the time binding to remove

getEntries

public TimeBinding[] getEntries()
Returns all the schedule entries in a time-ordered array

Returns:
a time-ordered array of time bindings

getFirstIndexAt

public int getFirstIndexAt(short time)

getEntry

public TimeBinding getEntry(int index)
Returns a schedule entry at the passed index

Parameters:
index - the index in the schedule
Returns:
binding the time binding at the index, or null if no such index

removeEntry

public void removeEntry(int index)

getRepeat

public int getRepeat()
Returns the repetition count of the schedule

Returns:
count how many times the schedule should be repeated

getNumEntries

public int getNumEntries()
Returns the number of entries in the schedule

Returns:
num the number of schedule entries

getLength

public int getLength()
Returns the number of minutes in the schedule

Returns:
length the length of the schedule in minutes

setRepeat

public void setRepeat(int repeat)

getNextSchedule

public java.lang.String getNextSchedule()
Returns the name of the schedule that follows this one

Returns:
successor the schedule to succeed this one

setNextSchedule

public void setNextSchedule(java.lang.String nextSched)


Copyright © 2006-2009 Richard Rodgers. All Rights Reserved.