rsvp.controller
Interface AppControllerInterface

All Known Implementing Classes:
AppController

public interface AppControllerInterface


Field Summary
static java.lang.String DEFAULT_FILENAME
          The default filename to save database state to.
 
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.
 

Field Detail

DEFAULT_FILENAME

static final java.lang.String DEFAULT_FILENAME
The default filename to save database state to.

See Also:
Constant Field Values
Method Detail

getEventCount

int getEventCount()
Returns the number of events currently in this application's event database.

Returns:
the number of events currently in this application's event database.

getEvent

EventControllerInterface getEvent(int id)
Creates and returns an EventController to mediate access to the event with the given ID. Throws a BogusParameterException if the given ID is invalid.

Precondition: id must be a valid event ID for the underlying database (as below).

Parameters:
id - the ID of a given event; must be between 0 (inclusive) and getEventCount() (exclusive).
Returns:
a newly-allocated EventController providing access to the event with the given event ID.

save

boolean save()
Saves the application state to the default save filename.

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.

Returns:
true if the save was successful and false otherwise

load

boolean load()
Loads the application state from the default save filename.

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.

Returns:
true if the load was successful and false otherwise

saveToFile

boolean saveToFile(java.lang.String filename)
Saves the application state to the given filename.

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.

Parameters:
filename - the file to save to
Returns:
true if the save was successful and false otherwise

loadFromFile

boolean loadFromFile(java.lang.String filename)
Loads the application state from the given filename.

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.

Parameters:
filename - the file to load from
Returns:
true if the load was successful and false otherwise