public class AppointmentModel extends Model implements Model.Listener, CategoryModel.CategorySource, Searchable<Appointment>
Model.ChangeEvent, Model.Listener| Modifier and Type | Method and Description |
|---|---|
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
|
addListener, getExistingModels, refreshListeners, refreshListeners, remove, removeListener, removeListeners, syncModelspublic static AppointmentModel getReference()
public static SimpleDateFormat getTimeFormat()
public static boolean isNote(Appointment appt)
appt - the appointmentpublic static boolean isSkipped(Appointment ap, Calendar cal)
ap - the Appointmentcal - the datepublic 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 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 exceptionpublic Collection<Appointment> get_todos()
public Collection<Appointment> getAllAppts() throws Exception
Exception - the exceptionpublic Appointment getAppt(int key) throws Exception
key - the keyException - the exceptionpublic List<Integer> getAppts(Date d)
d - the datepublic Collection<String> getCategories()
CategoryModel.CategorySourcegetCategories in interface CategoryModel.CategorySource@Deprecated public EntityDB<Appointment> getDB()
public void importXml(InputStream is) throws Exception
public Appointment newAppt()
public void update(Model.ChangeEvent event)
Model.Listenerupdate in interface Model.Listenerpublic void refresh()
public void saveAppt(Appointment r)
r - the appointmentpublic void saveAppt(Appointment r, boolean undo)
r - the appointmentundo - true if we are executing an undopublic double vacationCount(Date d)
d - the Datepublic void saveDefaultAppointment(Appointment appt)
appt - the appointmentpublic Appointment getDefaultAppointment()
public Collection<Appointment> search(SearchCriteria criteria)
Searchablesearch in interface Searchable<Appointment>criteria - the search criteriapublic String getExportName()
ModelgetExportName in class ModelGenerated March 24 2013 by mike using Apache Ant(TM) version 1.8.2 compiled on May 18 2012 and Java version 1.7.0_15 from Oracle Corporation on Linux i386 3.5.0-26-generic