com.monad.homerun.action
Class Month

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

public class Month
extends DataObject

The Month class holds an ordered list of entries for a calendar month. These entries currently include only date bindings, viz. actions set to start, run, or stop at a designated date/time.

See Also:
Serialized Form

Constructor Summary
Month()
           
Month(int year, int month)
           
 
Method Summary
 void addEntry(DateBinding entry)
          Adds a DateBinding entry to the month
 DateBinding[] getEntries()
          Returns all the month entries in a time-ordered array
 DateBinding[] getEntries(short day)
          Returns all the month entries for a given day in a time-ordered array
 DateBinding[] getEntriesAfter(short day, short minutes)
          Returns all the month entries for a minute after a given day and time in a time-ordered array
 DateBinding getEntry(int index)
          Returns a month entry at the passed index
 java.lang.Integer[] getEntryDays()
          Returns all the days of the month containing entries in an ordered array
 int getMonth()
           
 int getNumEntries()
          Returns the number of entries in the month
 int getYear()
           
 void loadEntries(DateBinding[] entries)
           
 void removeEntry(DateBinding entry)
          Removes a time binding entry from the month
 void removeEntry(int index)
           
 
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
 

Constructor Detail

Month

public Month()

Month

public Month(int year,
             int month)
Method Detail

loadEntries

public void loadEntries(DateBinding[] entries)

removeEntry

public void removeEntry(DateBinding entry)
Removes a time binding entry from the month

Parameters:
entry - the date binding to remove

addEntry

public void addEntry(DateBinding entry)
Adds a DateBinding entry to the month

Parameters:
entry - the date binding to add

getEntries

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

Returns:
a time-ordered array of date bindings

getEntries

public DateBinding[] getEntries(short day)
Returns all the month entries for a given day in a time-ordered array

Parameters:
day - the day of the month
Returns:
a time-ordered array of date bindings

getEntriesAfter

public DateBinding[] getEntriesAfter(short day,
                                     short minutes)
Returns all the month entries for a minute after a given day and time in a time-ordered array

Parameters:
day - the day of the month
minutes - the minutes of the day
Returns:
a time-ordered array of date bindings

getEntryDays

public java.lang.Integer[] getEntryDays()
Returns all the days of the month containing entries in an ordered array

Returns:
a time-ordered array of day indices

getEntry

public DateBinding getEntry(int index)
Returns a month entry at the passed index

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

removeEntry

public void removeEntry(int index)

getNumEntries

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

Returns:
num the number of month entries

getYear

public int getYear()

getMonth

public int getMonth()


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