T
- the type of XdmItem
that is returned by the step. (Note that we
don't parameterize Steps by the type of input item).public abstract class Step<T extends XdmItem> extends java.lang.Object implements java.util.function.Function<XdmItem,java.util.stream.Stream<? extends T>>
Step
is a function that can be applied to an item
to return a stream of items.Steps
Constructor and Description |
---|
Step() |
Modifier and Type | Method and Description |
---|---|
Step<T> |
at(long index)
Obtain a step that selects the Nth item in the results of this step
|
Step<T> |
cat(Step<T> other)
Obtain a
Step that concatenates the results of this Step with the result of another
Step applied to the same input item. |
Step<T> |
first()
Obtain a step that selects the first item in the results of this step
|
Step<T> |
last()
Obtain a step that selects the last item in the results of this step
|
<U extends XdmItem> |
then(Step<U> next)
Obtain a step that combines the results of this step with the results of another step
|
Step<T> |
where(java.util.function.Predicate<? super T> predicate)
Obtain a
Step that filters the results of this Step using a supplied predicate. |
public Step<T> where(java.util.function.Predicate<? super T> predicate)
Step
that filters the results of this Step using a supplied predicate.
For example, CHILD.where(isText())
returns a Step whose effect is
to select the text node children of a supplied element or document node.
predicate
- the predicate which will be applied to the results of this steppublic Step<T> cat(Step<T> other)
Step
that concatenates the results of this Step with the result of another
Step applied to the same input item.
For example, attribute().cat(child())
returns a step whose effect is
to select the attributes of a supplied element followed by its children.
other
- the step whose results will be concatenated with the results of this steppublic Step<T> first()
public Step<T> last()
public Step<T> at(long index)
index
- the zero-based index of the item to be selectedpublic <U extends XdmItem> Step<U> then(Step<U> next)
next
- the step which will be applied to the results of this stepCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.