Package org.jsoup.select
Class Collector
java.lang.Object
org.jsoup.select.Collector
Collects a list of elements that match the supplied criteria.
- Author:
- Jonathan Hedley
-
Method Summary
Modifier and TypeMethodDescriptionstatic ElementsBuild a list of elements, by visiting the root and every descendant of root, and testing it against the Evaluator.static @Nullable ElementFinds the first Element that matches the Evaluator that descends from the root, and stops the query once that first match is found.Obtain a Stream of elements by visiting the root and every descendant of root and testing it against the evaluator.
-
Method Details
-
collect
Build a list of elements, by visiting the root and every descendant of root, and testing it against the Evaluator.- Parameters:
eval- Evaluator to test elements againstroot- root of tree to descend- Returns:
- list of matches; empty if none
-
stream
Obtain a Stream of elements by visiting the root and every descendant of root and testing it against the evaluator.- Parameters:
evaluator- Evaluator to test elements againstroot- root of tree to descend- Returns:
- A
Streamof matches - Since:
- 1.19.1
-
findFirst
Finds the first Element that matches the Evaluator that descends from the root, and stops the query once that first match is found.- Parameters:
eval- Evaluator to test elements againstroot- root of tree to descend- Returns:
- the first match;
nullif none
-