Constructor and Description |
---|
NodeQueryImpl() |
Modifier and Type | Method and Description |
---|---|
NodeQuery |
from(Collection<Node> parentNodes)
Stores all given
parentNodes within this NodeQuery |
NodeQuery |
from(Node... parentNodes)
Stores all given
parentNodes within this NodeQuery |
NodeQuery |
lookup(Function<Node,Set<Node>> function)
Sifts through stored nodes and uses
function to determine which nodes to keep and which to remove. |
<T> NodeQuery |
lookup(org.hamcrest.Matcher<T> matcher)
Sifts through stored nodes and keeps only those
Node s that match the given matcher. |
<T extends Node> |
lookup(Predicate<T> predicate)
Sifts through stored nodes and keeps only those
Node s that pass the given predicate . |
NodeQuery |
lookup(String query)
Sifts through stored nodes by their id ("#id"), their class (".class"), or the text it has ("text"),
depending on the query used, and keeps only those
Node s that meet the query. |
<T> NodeQuery |
match(org.hamcrest.Matcher<T> matcher)
Sifts through stored nodes and removes all
Node s that match the given matcher. |
<T extends Node> |
match(Predicate<T> predicate)
Sifts through stored nodes and removes all
Node s that pass the given predicate. |
NodeQuery |
nth(int index)
Keeps the nth
Node in stored nodes and removes all others. |
<T extends Node> |
query() |
<T extends Node> |
queryAll() |
<T extends Node> |
tryQuery() |
public NodeQuery from(Node... parentNodes)
NodeQuery
parentNodes
within this NodeQuerypublic NodeQuery from(Collection<Node> parentNodes)
NodeQuery
parentNodes
within this NodeQuerypublic NodeQuery lookup(String query)
NodeQuery
Node
s that meet the query.public <T> NodeQuery lookup(org.hamcrest.Matcher<T> matcher)
NodeQuery
Node
s that match the given matcher.public <T extends Node> NodeQuery lookup(Predicate<T> predicate)
NodeQuery
Node
s that pass the given predicate
.public NodeQuery lookup(Function<Node,Set<Node>> function)
NodeQuery
function
to determine which nodes to keep and which to remove.public <T> NodeQuery match(org.hamcrest.Matcher<T> matcher)
NodeQuery
Node
s that match the given matcher.public <T extends Node> NodeQuery match(Predicate<T> predicate)
NodeQuery
Node
s that pass the given predicate.public NodeQuery nth(int index)
NodeQuery
Node
in stored nodes and removes all others.public <T extends Node> T query()