Develop #1
+19
-3
@@ -1,4 +1,5 @@
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@@ -9,10 +10,25 @@ public class Main {
|
|||||||
// Instantiate the parser
|
// Instantiate the parser
|
||||||
Parser parser = new Parser(filePath);
|
Parser parser = new Parser(filePath);
|
||||||
|
|
||||||
// TODO: You can test your code here before you run the unit tests.
|
System.out.println("--- Movies Sorted By Title ---");
|
||||||
// Example: Call your sorting methods, iterate through the returned list,
|
List<Movie> sortedByTitle = parser.sortByTitle();
|
||||||
// and print out the movies to see if they match the expected results in the Help folder.
|
for (Movie movie : sortedByTitle) {
|
||||||
|
System.out.println(movie.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Testing sortByRating
|
||||||
|
System.out.println("\n--- Movies Sorted By Rating (Descending) ---");
|
||||||
|
List<Movie> sortedByRating = parser.sortByRating();
|
||||||
|
for (Movie movie : sortedByRating) {
|
||||||
|
System.out.println(movie.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Testing sortByYear
|
||||||
|
System.out.println("\n--- Movies Sorted By Year (Descending) ---");
|
||||||
|
List<Movie> sortedByYear = parser.sortByYear();
|
||||||
|
for (Movie movie : sortedByYear) {
|
||||||
|
System.out.println(movie.toString());
|
||||||
|
}
|
||||||
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