public interface NodeQuery
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() |
NodeQuery from(Node... parentNodes)
parentNodes
within this NodeQueryparentNodes
- the parentNodes to storeNodeQuery from(Collection<Node> parentNodes)
parentNodes
within this NodeQueryparentNodes
- the parentNodes to storeNodeQuery lookup(String query)
Node
s that meet the query.query
- the query to use<T> NodeQuery lookup(org.hamcrest.Matcher<T> matcher)
Node
s that match the given matcher.T
- matcher typematcher
- the matcher used to determine which Node
s to keep and which to remove<T extends Node> NodeQuery lookup(Predicate<T> predicate)
Node
s that pass the given predicate
.T
- type that extends Node
predicate
- the predicate used to determine which Node
s to keep and which to remove.NodeQuery lookup(Function<Node,Set<Node>> function)
function
to determine which nodes to keep and which to remove.function
- that returns the Node
s to keep<T> NodeQuery match(org.hamcrest.Matcher<T> matcher)
Node
s that match the given matcher.T
- matcher typematcher
- that determines which Node
s to remove<T extends Node> NodeQuery match(Predicate<T> predicate)
Node
s that pass the given predicate.T
- predicate typepredicate
- that indicates which Node
s to removeNodeQuery nth(int index)
Node
in stored nodes and removes all others.index
- within the collection of Node
s<T extends Node> T query()
T
- type that extends Node
<T extends Node> Optional<T> tryQuery()
T
- type that extends Node