HW5
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user