makeing output improvements
This commit is contained in:
+20
-9
@@ -7,28 +7,39 @@ public class Main {
|
||||
String filePath = "src/main/resources/Movies.html";
|
||||
|
||||
try {
|
||||
// Instantiate the parser
|
||||
Parser parser = new Parser(filePath);
|
||||
|
||||
System.out.println("--- Movies Sorted By Title ---");
|
||||
System.out.println("==================================================");
|
||||
System.out.println(" IMDb MOVIE SCRAPER ");
|
||||
System.out.println("==================================================\n");
|
||||
|
||||
// sortByTitle
|
||||
System.out.println("[ MOVIES SORTED BY TITLE ]");
|
||||
System.out.println("--------------------------------------------------");
|
||||
List<Movie> sortedByTitle = parser.sortByTitle();
|
||||
for (Movie movie : sortedByTitle) {
|
||||
System.out.println(movie.toString());
|
||||
System.out.println(" • " + movie.toString());
|
||||
}
|
||||
|
||||
// Testing sortByRating
|
||||
System.out.println("\n--- Movies Sorted By Rating (Descending) ---");
|
||||
// sortByRating
|
||||
System.out.println("\n[ MOVIES SORTED BY RATING (DESCENDING) ]");
|
||||
System.out.println("--------------------------------------------------");
|
||||
List<Movie> sortedByRating = parser.sortByRating();
|
||||
for (Movie movie : sortedByRating) {
|
||||
System.out.println(movie.toString());
|
||||
System.out.println(" • " + movie.toString());
|
||||
}
|
||||
|
||||
// Testing sortByYear
|
||||
System.out.println("\n--- Movies Sorted By Year (Descending) ---");
|
||||
//sortByYear
|
||||
System.out.println("\n[ MOVIES SORTED BY YEAR (DESCENDING) ]");
|
||||
System.out.println("--------------------------------------------------");
|
||||
List<Movie> sortedByYear = parser.sortByYear();
|
||||
for (Movie movie : sortedByYear) {
|
||||
System.out.println(movie.toString());
|
||||
System.out.println(" • " + movie.toString());
|
||||
}
|
||||
|
||||
System.out.println("\n==================================================");
|
||||
System.out.println(" >> Movies parsed successfully! Total movies: " + sortedByTitle.size());
|
||||
System.out.println("==================================================");
|
||||
System.out.println("Movies parsed successfully! Total movies: " + parser.sortByTitle().size());
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user