|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.borg.model.Model
net.sf.borg.model.AppointmentModel
public class AppointmentModel
the appointment model provides the model layer APIs for working with Appointment Entities
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.borg.model.Model |
---|
Model.Listener |
Method Summary | |
---|---|
void |
delAppt(Appointment appt)
Delete an appt. |
void |
delAppt(Appointment appt,
boolean undo)
Delete an appt. |
void |
delAppt(int key)
Delete an appt by key. |
void |
delOneOnly(int key,
Date rptDate)
delete one occurrence of a repeating appointment |
void |
do_todo(int key,
boolean del)
Mark a todo appointment as done. |
void |
export(Writer fw)
Export appointments as XML. |
Collection<Appointment> |
get_todos()
Gets all appointments that are marked as todos. |
Collection<Appointment> |
getAllAppts()
Get all appts. |
Appointment |
getAppt(int key)
Gets an appt by key. |
List<Integer> |
getAppts(Date d)
Get a list of appointment ids for a given day |
Collection<String> |
getCategories()
Gets the list of all categories from all entities in the source model |
EntityDB<Appointment> |
getDB()
Deprecated. |
Appointment |
getDefaultAppointment()
get the default appointment from prefs |
static AppointmentModel |
getReference()
Gets the singleton reference. |
static SimpleDateFormat |
getTimeFormat()
Gets the time format to use for all time processing. |
boolean |
haveTodos()
return true if there are any todos in the entire appointment table |
void |
importXml(String fileName)
Import xml. |
static boolean |
isNote(Appointment appt)
Checks an appointment is a note (not associated with a time of day). |
static boolean |
isSkipped(Appointment ap,
Calendar cal)
Checks if an appointment is skipped on a particular date |
Appointment |
newAppt()
create a new appointment. |
void |
refresh()
Called to notify Listener when the Model is changed. |
void |
saveAppt(Appointment r)
Save an appointment. |
void |
saveAppt(Appointment r,
boolean undo)
Save an appointment. |
void |
saveDefaultAppointment(Appointment appt)
save the default appointment in the prefs |
Collection<Appointment> |
search(SearchCriteria criteria)
Return a collection of all records that match the given search criteria |
void |
sync()
Sync with the db. |
double |
vacationCount(Date d)
determine the number of vacation days up to and including the given day in a particular year |
Methods inherited from class net.sf.borg.model.Model |
---|
addListener, refreshListeners, remove, removeListener, removeListeners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AppointmentModel getReference()
public static SimpleDateFormat getTimeFormat()
public static boolean isNote(Appointment appt)
appt
- the appointment
public static boolean isSkipped(Appointment ap, Calendar cal)
ap
- the Appointmentcal
- the date
public void delAppt(Appointment appt)
appt
- the apptpublic void delAppt(Appointment appt, boolean undo)
appt
- the apptundo
- true if we are executing an undopublic void delAppt(int key)
key
- the keypublic void delOneOnly(int key, Date rptDate)
key
- the appointment keyrptDate
- the date of the repeat to be deletedpublic void do_todo(int key, boolean del) throws Exception
key
- the appointment keydel
- if true, delete the todo when all done. Otherwise, mark it as
no longer being a todo.
Exception
- the exceptionpublic void export(Writer fw) throws Exception
fw
- the Writer to write XML to
Exception
- the exceptionpublic Collection<Appointment> get_todos()
public Collection<Appointment> getAllAppts() throws Exception
Exception
- the exceptionpublic Appointment getAppt(int key) throws Exception
key
- the key
Exception
- the exceptionpublic List<Integer> getAppts(Date d)
d
- the date
public Collection<String> getCategories()
CategoryModel.CategorySource
getCategories
in interface CategoryModel.CategorySource
@Deprecated public EntityDB<Appointment> getDB()
public boolean haveTodos()
public void importXml(String fileName) throws Exception
fileName
- the file name of the file containing the XML
Exception
- the exceptionpublic Appointment newAppt()
public void refresh()
Model.Listener
refresh
in interface Model.Listener
public void saveAppt(Appointment r)
r
- the appointmentpublic void saveAppt(Appointment r, boolean undo)
r
- the appointmentundo
- true if we are executing an undopublic void sync()
public double vacationCount(Date d)
d
- the Date
public void saveDefaultAppointment(Appointment appt)
appt
- the appointmentpublic Appointment getDefaultAppointment()
public Collection<Appointment> search(SearchCriteria criteria)
Searchable
search
in interface Searchable<Appointment>
criteria
- the search criteria
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |