/** * getMovieInformation gets the movie description, the poster link, and the actors from the list * of movies as the parameter. They are returned in an ArrayList<Movie> as movie objects, which * you will be able to get all the movies information. * * @author defq0n * @param movieList is a multidimensional array from getMovieListInformation. * @return movieArray a ArrayList containing Movie objects. */ private static ArrayList<Movie> getMovieInformation(String[][] movieList) { ArrayList<Movie> movieArray = new ArrayList<>(); for (int i = 0; i < movieList[0].length; i++) { if (!movieList[3][i].equals("")) { if (movieList[3][i].toLowerCase().contains("movie")) { Movie tempMovie = new Movie(movieList[1][i]); String pageLink = movieList[0][i]; tempMovie.setPageLink(pageLink); tempMovie.setMovieYear(movieList[2][i]); tempMovie.setMovieDescription(getMovieDescription(pageLink)); tempMovie.setPosterLink(getPosterLink(pageLink)); tempMovie.setActors(getMovieActors(pageLink)); tempMovie.setGenre(getGenre(pageLink)); tempMovie.setTrailerLink(getTrailer(tempMovie)); movieArray.add(tempMovie); } } } return movieArray; }
private static void testGetTrailer() { Movie m = new Movie("Harry Potter and the Sorcerer's Stone"); m.setMovieYear("2001"); m.setTrailerLink(getTrailer(m)); System.out.println(m.getTrailerLink()); }