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