public final class MovieDAO extends Object
Movie
objects.
Implements persistence for movie information. This class uses a simple text file called movie_list_for_<user name>.txt, stored locally, in the application's home directory. Each logged in user gets their own list. Each logged in user can see their own list, but they cannot see anyone else's list.
The format of the file is specific to this application. The file should not be edited directly by an end user, in case the format is violated.
Upon startup, all records in the data-store are read into memory. Edits are performed initially only in memory. When the application shuts down, then the updated data store is written back to the disk, for use during the next launch of the application.
Constructor and Description |
---|
MovieDAO() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
add(Movie aMovie)
Add a new
Movie . |
(package private) void |
change(Movie aMovie)
Change an existing
Movie . |
(package private) void |
delete(String aMovieId)
Delete an existing
Movie , given the movie id. |
(package private) List<Movie> |
list()
List all
Movie s. |
void |
shutdown()
Save all data to a text file.
|
Copyright Hirondelle Systems - Generated 2013Sep20.11.16