|
|
@ -4,6 +4,7 @@ import java.io.FileWriter; |
|
|
import java.io.File; |
|
|
import java.io.File; |
|
|
import java.util.Scanner; |
|
|
import java.util.Scanner; |
|
|
import java.io.FileNotFoundException; |
|
|
import java.io.FileNotFoundException; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
public class Database { |
|
|
public class Database { |
|
|
|
|
|
|
|
|
@ -80,5 +81,31 @@ public class Database { |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static int findMovieId(String title) |
|
|
|
|
|
{ |
|
|
|
|
|
// TODO 6: search all titles and find matching movie id , return 0 if not found |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void incNumWatched(int movieId) |
|
|
|
|
|
{ |
|
|
|
|
|
// TODO 7: find movie by id and increment numWatched by 1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Movie findTopMovieByGenre(String genre) |
|
|
|
|
|
{ |
|
|
|
|
|
Movie m = new Movie(); |
|
|
|
|
|
// TODO 8: search all movies by genre, and find the one with the top rating and return it |
|
|
|
|
|
return m; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static ArrayList<Movie> findMoviesForStar(String starName) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Movie> list = new ArrayList<Movie>(); |
|
|
|
|
|
// TODO 9: search all movies in which the star has acted and return a list |
|
|
|
|
|
return list; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |