public class DomSupport extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
anyNodeInTheHierarchyMatches(Node node,
Predicate<Node> predicate)
Checks the given node's complete hierarchy (i.e.
|
static boolean |
anyNodesInTheAncestryMatches(Node node,
Predicate<Node> predicate)
Checks the given node's ancestors to see if the provided predicate reports
true
for at least one node. |
static Predicate<Node> |
anyNodesInTheHierarchy(Predicate<Node> predicate)
Returns a new predicate that will report
true if any of the nodes in the hierarchy
of the tested node yields true when tested with the provided predicate. |
static boolean |
anyNodesInTheLineageMatches(Node node,
Predicate<Node> predicate)
Checks the given node's descendants to see if the provided predicate reports
true
for at least one node. |
public static Predicate<Node> anyNodesInTheHierarchy(Predicate<Node> predicate)
true
if any of the nodes in the hierarchy
of the tested node yields true
when tested with the provided predicate.predicate
- the predicate to test withtrue
public static boolean anyNodeInTheHierarchyMatches(Node node, Predicate<Node> predicate)
true
for at least one node. This
method will stop searching as soon as the predicate reports true
for any node in
the hierarchy.node
- the node to test the predicate against its hierarchypredicate
- the predicate to test withtrue
if the predicate reports true
for at least one node;
false
otherwisepublic static boolean anyNodesInTheAncestryMatches(Node node, Predicate<Node> predicate)
true
for at least one node. This method will stop searching as soon as the predicate reports
true
for any node in the ancestry.node
- the node to test the predicate against its ancestrypredicate
- the predicate to test withtrue
if the predicate reports true
for at least one node;
false
otherwisepublic static boolean anyNodesInTheLineageMatches(Node node, Predicate<Node> predicate)
true
for at least one node. This method will stop searching as soon as the predicate reports
true
for any node in the lineage.node
- the node to test the predicate against its lineagepredicate
- the predicate to test withtrue
if the predicate reports true
for at least one node;
false
otherwiseThis work is licensed under a Creative Commons Attribution 4.0 International License.