|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrsvp.controller.AppController
public class AppController
The AppController is the main controller for the RSVP application. It provides a layer of functionality related to making new events, retrieving event information, and dealing with event database metadata. The view classes will interact with the AppController after the main application has created an EventDB.
Field Summary |
---|
Fields inherited from interface rsvp.controller.AppControllerInterface |
---|
DEFAULT_FILENAME |
Constructor Summary | |
---|---|
AppController(EventDBInterface db)
Creates a new AppController to mediate access to a particular EventDB. |
Method Summary | |
---|---|
EventControllerInterface |
getEvent(int id)
Creates and returns an EventController to mediate access to the event with the given ID. |
int |
getEventCount()
Returns the number of events currently in this application's event database. |
boolean |
load()
Loads the application state from the default save filename. |
boolean |
loadFromFile(java.lang.String filename)
Loads the application state from the given filename. |
boolean |
save()
Saves the application state to the default save filename. |
boolean |
saveToFile(java.lang.String filename)
Saves the application state to the given filename. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AppController(EventDBInterface db)
db
- an EventDBMethod Detail |
---|
public int getEventCount()
AppControllerInterface
getEventCount
in interface AppControllerInterface
public EventControllerInterface getEvent(int id)
AppControllerInterface
Precondition: id must be a valid event ID for the underlying database (as below).
getEvent
in interface AppControllerInterface
id
- the ID of a given event; must be between 0 (inclusive) and getEventCount() (exclusive).
public boolean save()
AppControllerInterface
Note: It is optional to implement this method; if you choose not to, you can simply have it return false. If you do implement this method, you may want to use the DBPersistence class from the rsvp.util package.
save
in interface AppControllerInterface
public boolean load()
AppControllerInterface
Note: It is optional to implement this method; if you choose not to, you can simply have it return false. If you do implement this method, you may want to use the DBPersistence class from the rsvp.util package.
load
in interface AppControllerInterface
public boolean saveToFile(java.lang.String filename)
AppControllerInterface
Note: It is optional to implement this method; if you choose not to, you can simply have it return false. If you do implement this method, you may want to use the DBPersistence class from the rsvp.util package.
saveToFile
in interface AppControllerInterface
filename
- the file to save to
public boolean loadFromFile(java.lang.String filename)
AppControllerInterface
Note: It is optional to implement this method; if you choose not to, you can simply have it return false. If you do implement this method, you may want to use the DBPersistence class from the rsvp.util package.
loadFromFile
in interface AppControllerInterface
filename
- the file to load from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |