This commit is contained in:
2026-05-07 21:13:17 +03:30
parent bc46d28fd5
commit 35224d0621
9 changed files with 513 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.File;
import java.io.IOException;
import java.util.*;
public class Parser {
static List<Movie> movies = new ArrayList<>();
public List<Movie> sortByTitle() {
List<Movie> sortedByTitle = new ArrayList<>(movies);
// Sort movies alphabetically by title
//TODO
return sortedByTitle;
}
public List<Movie> sortByRating() {
List<Movie> sortedByRating = new ArrayList<>(movies);
// Sort movies by rating (highest to lowest)
//TODO
return sortedByRating;
}
public List<Movie> sortByYear() {
List<Movie> sortedByYear = new ArrayList<>(movies);
// Sort movies by year (newest to oldest)
//TODO
return sortedByYear;
}
public void setUp() throws IOException {
// Parse the HTML file using Jsoup
//TODO
// Extract data from the HTML
//TODO
// Iterate through each movie div to extract movie data
//TODO
}
public static void main(String[] args) {
// You can test your code here before you run the unit tests
}
}