usflix
Class MovieDatabase

java.lang.Object
  extended by usflix.MovieDatabase

public class MovieDatabase
extends java.lang.Object

MovieDatabase class manages movie database and provides search methods.

Version:
2.0 March 3, 2013.
Author:
EJ Jung

Field Summary
private  java.util.ArrayList<Movie> movies
           
 
Constructor Summary
MovieDatabase(java.lang.String filename)
          Default constructor for MovieDatabase.
 
Method Summary
 boolean addMovie(Movie m)
          Add a new movie object m to the database (ArrayList)
 java.util.ArrayList<Movie> searchByTitle(java.lang.String[] keywords)
          Search for the movies that contain all the keywords given in the parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

movies

private java.util.ArrayList<Movie> movies
Constructor Detail

MovieDatabase

public MovieDatabase(java.lang.String filename)
Default constructor for MovieDatabase.

Parameters:
filename - The file that contains Movie information
Method Detail

addMovie

public boolean addMovie(Movie m)
Add a new movie object m to the database (ArrayList)

Parameters:
m - A new Movie object
Returns:
true if m is added to the database successfully, false otherwise

searchByTitle

public java.util.ArrayList<Movie> searchByTitle(java.lang.String[] keywords)
Search for the movies that contain all the keywords given in the parameter. Returns ArrayList of all matching Movie objects.

Parameters:
keywords - array of keywords
Returns:
ArrayList that contains the Movie objects that match all keywords