caltool.view
Class Lists
java.lang.Object
java.util.Observable
mvp.Model
caltool.view.Lists
- All Implemented Interfaces:
- java.io.Serializable
public class Lists
- extends mvp.Model
Class Lists is the model class that encapsulates the View->Lists commands.
These are commands to list appointments, meetings, tasks, events, and all
items. Lists also has a reference to the CustomLists class, which has
methods and data to support editing custom lists of items.
There are couple design alternatives for this class. In Alternative 1, the
way the class is currently designed, this Lists class supplies
array-returning methods that trace to the operations in the abstract spec.
These methods have been refined to return array values intstead of whole
model objects. This refinement supports the companion view classes that are
implemented as JTables, the rows of which are easily populated with
array-valued data.
Alternative 2, not currently implemented, would be patterned after the
current MontlyAgenda/MonthlyAgendaDisplay design. In this version of the
design,, the Lists class would have data fields that point to instances of
AppointmentLists, etc, and each such list class would provide iterator
methods, a la MontlyAgenda. In this case, the traceable
viewAppointmentsList method returns a (persistent) AppointmentList object
that serves as the appointment list factory, a la MonthlyAgenda.
Alternative 1 is more directly traceable to the spec, and more functional in
style, since the return values of the methods are not persistent objects.
Alternative 2 can be considered more object-oriented in style, with its
persistent object instances and iterator methods. I see no real qualitative
difference between the two designs, only a stylistic difference.
- See Also:
- Serialized Form
Fields inherited from class mvp.Model |
view |
Method Summary |
protected java.lang.Object[] |
generateSampleList()
Generate a sample appointments list for initial view testing. |
java.lang.Object[] |
viewAppointmentsList()
List all appointments between the current list-start and list-end option
settings. |
Methods inherited from class mvp.Model |
dump, exit, getView, setView |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Lists
public Lists(CalendarDB caldb)
viewAppointmentsList
public java.lang.Object[] viewAppointmentsList()
- List all appointments between the current list-start and list-end option
settings. The default start/end setting is the three-week period
starting one week prior to today's date through two weeks after today's
date. The list of values is returned in an array of AppointmentListItems .
The current implementation is a stub that returns a sample list with
values taken from
Figure 32 of the requirements.
generateSampleList
protected java.lang.Object[] generateSampleList()
- Generate a sample appointments list for initial view testing. The list
is based on
../../requirements/list-viewing.html#Figure Basic Appointments List>
Figure 32 of the requirements, with additional data added to
reflect that which is not visible in the default 20-line view. The data
were generated with the assistance of Emacs editing macros.