|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectusflix.Driver
public class Driver
Driver class manages user interaction: input and output between the program and users
Field Summary | |
---|---|
private static MovieDatabase |
movieDB
There will be only one movie database and one user database in the system, so they are declared as static. |
private static UserDatabase |
userDB
|
Constructor Summary | |
---|---|
Driver()
|
Method Summary | |
---|---|
private static void |
listMenu(User u,
java.util.ArrayList<Movie> list)
listMenu handles printing the list of Movies with the appropriate rating (user's own if available, average otherwise), letting user rate any of the Movies in the list. |
private static void |
loadUsers(java.lang.String filename)
loadUsers() method loads the user information from a file. |
static void |
main(java.lang.String[] args)
The first program argument (args[0]) may contain the movie information file name, and the second program argument (args[1]) may contain the user information file name. |
private static void |
userMenu(User u)
userMenu handles menu options that are available after logging in, such as search by title (and director if you have it) and the list of movies the user has seen before. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static MovieDatabase movieDB
private static UserDatabase userDB
Constructor Detail |
---|
public Driver()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- private static void loadUsers(java.lang.String filename) throws java.io.FileNotFoundException
filename
- the user information file name
java.io.FileNotFoundException
- if the user information file is not found,
then the main method catches the exception and asks user for another file name.private static void userMenu(User u)
u
- private static void listMenu(User u, java.util.ArrayList<Movie> list)
u
- list
- search result or the list of movies user has seen
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |