|
||||||||||
| 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.ChangeEvent, 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 |
do_todo(int key,
boolean del,
Date date)
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 |
String |
getExportName()
get the root XML element name for this model's XML representation |
String |
getInfo()
return user readable information about the model |
static AppointmentModel |
getReference()
Gets the singleton reference. |
static SimpleDateFormat |
getTimeFormat()
Gets the time format to use for all time processing. |
void |
importXml(InputStream is)
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()
|
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. |
void |
update(Model.ChangeEvent event)
Called to notify Listener when the Model is changed. |
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, getExistingModels, refreshListeners, refreshListeners, remove, removeListener, removeListeners, syncModels |
| 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 appt
public void delAppt(Appointment appt,
boolean undo)
appt - the apptundo - true if we are executing an undopublic void delAppt(int key)
key - the key
public void delOneOnly(int key,
Date rptDate)
key - the appointment keyrptDate - the date of the repeat to be deleted
public 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 exception
public void do_todo(int key,
boolean del,
Date date)
throws Exception
key - the appointment keydel - if true, delete the todo when all done. Otherwise, mark it as
no longer being a todo.date - date of the repeat that is being marked as done. If null, then the next todo is the one.
If set, then all todos up to and including the date are marked as done.
Exception - the exception
public void export(Writer fw)
throws Exception
export in class Modelfw - the Writer to write XML to
Exception - the exceptionpublic Collection<Appointment> get_todos()
public Collection<Appointment> getAllAppts()
throws Exception
Exception - the exception
public 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 void importXml(InputStream is)
throws Exception
importXml in class Modelis - the input stream containing the XML
Exception - the exceptionpublic Appointment newAppt()
public void update(Model.ChangeEvent event)
Model.Listener
update in interface Model.Listenerpublic void refresh()
public void saveAppt(Appointment r)
r - the appointment
public void saveAppt(Appointment r,
boolean undo)
r - the appointmentundo - true if we are executing an undopublic void sync()
sync in class Modelpublic 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
public String getExportName()
Model
getExportName in class Model
public String getInfo()
throws Exception
Model
getInfo in class ModelException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||