|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectMovieDAO
public final class MovieDAO
Data Access Object (DAO) for 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 datastore 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 Summary | |
|---|---|
MovieDAO()
|
|
| Method Summary | |
|---|---|
(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 Movies. |
void |
shutdown()
Save all data to a text file. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MovieDAO()
| Method Detail |
|---|
public void shutdown()
void add(Movie aMovie)
Movie.
void change(Movie aMovie)
Movie.
List<Movie> list()
Movies. Order is the natural order of the Movie class
(descending date, then title).
void delete(String aMovieId)
Movie, given the movie id.
|
My Movies 1.0.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||