Class Node<T extends Node<T>>
- Type Parameters:
T- node type
- All Implemented Interfaces:
NamedWriteable,Writeable
- Direct Known Subclasses:
Expression
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumConfiguration for rendering the string representation.Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of lines rendered bytoString().static final intMaximum number of characters per line rendered bytoString(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanchildren()collectFirstChildren(Predicate<? super T> predicate) protected voiddoCollectFirst(Predicate<? super T> predicate, List<T> matches) boolean<E extends T>
voidforEachDown(Class<E> typeToken, Consumer<? super E> action) voidforEachDown(Consumer<? super T> action) protected <E> voidforEachProperty(Class<E> typeToken, Consumer<? super E> rule) <E> voidforEachPropertyDown(Class<E> typeToken, Consumer<? super E> rule) <E> voidforEachPropertyOnly(Class<E> typeToken, Consumer<? super E> rule) <E> voidforEachPropertyUp(Class<E> typeToken, Consumer<? super E> rule) <E extends T>
voidvoidinthashCode()info()Return the information about this node.nodeName()The values of all the properties that are important to thisNode.final StringvoidnodeString(StringBuilder sb, Node.NodeStringFormat format) Append thisNode's string representation tosb.protected voidpropertiesToString(StringBuilder sb, boolean skipIfChild, Node.NodeStringFormat format) abstract TreplaceChildren(List<T> newChildren) final TreplaceChildrenSameSize(List<T> newChildren) source()toString()toString(Node.NodeStringFormat format) protected voidtransformChildren(BiConsumer<T, ActionListener<T>> traversalOperation, ActionListener<T> listener) transformChildren(Function<T, ? extends T> traversalOperation) transformDown(Class<E> typeToken, Function<E, ? extends T> rule) voidtransformDown(BiConsumer<? super T, ActionListener<T>> rule, ActionListener<T> listener) Asynchronous variant oftransformDown(Function)that allows the transformation rule to perform async I/O operations (e.g., transport actions) without blocking the caller thread.transformDown(Function<? super T, ? extends T> rule) transformDown(Predicate<Node<?>> nodePredicate, Function<E, ? extends T> rule) protected final <E> TtransformNodeProps(Class<E> typeToken, Function<? super E, ? extends E> rule) Transform this node's properties.<E> TtransformPropertiesDown(Class<E> typeToken, Function<? super E, ? extends E> rule) <E> TtransformPropertiesOnly(Class<E> typeToken, Function<? super E, ? extends E> rule) <E> TtransformPropertiesUp(Class<E> typeToken, Function<? super E, ? extends E> rule) transformUp(Class<E> typeToken, Function<E, ? extends T> rule) transformUp(Function<? super T, ? extends T> rule) transformUp(Predicate<Node<?>> nodePredicate, Function<E, ? extends T> rule) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
Field Details
-
TO_STRING_MAX_WIDTH
public static final int TO_STRING_MAX_WIDTHMaximum number of characters per line rendered bytoString().- See Also:
-
TO_STRING_MAX_LINES
public static final int TO_STRING_MAX_LINESMaximum number of lines rendered bytoString().- See Also:
-
-
Constructor Details
-
Node
-
-
Method Details
-
source
-
sourceLocation
-
sourceText
-
children
-
forEachDown
-
forEachDown
-
forEachUp
-
forEachUp
-
forEachPropertyOnly
-
forEachPropertyDown
-
forEachPropertyUp
-
forEachProperty
-
anyMatch
-
collect
-
collectLeaves
-
collectFirstChildren
-
doCollectFirst
-
transformDown
-
transformDown
-
transformDown
-
transformDown
Asynchronous variant oftransformDown(Function)that allows the transformation rule to perform async I/O operations (e.g., transport actions) without blocking the caller thread.Children are transformed sequentially, not concurrently, one after another in order. This method is intended for cases where async I/O is needed during transformation, not for parallel processing.
-
transformChildren
protected void transformChildren(BiConsumer<T, ActionListener<T>> traversalOperation, ActionListener<T> listener) -
transformUp
-
transformUp
-
transformUp
-
transformChildren
-
replaceChildrenSameSize
-
replaceChildren
-
transformPropertiesOnly
-
transformPropertiesDown
-
transformPropertiesUp
-
transformNodeProps
Transform this node's properties.This always returns something of the same type as the current node but since
Nodedoesn't have aSelfTparameter we return the closest thing we do have:T, which is the root of the hierarchy for this node. -
info
Return the information about this node.Normally, you want to use one of the static
createmethods to implement this.For
QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all of the properties are used in the provided constructor; otherwise query plan transformations likeQueryPlan#transformExpressionsOnly(Function)will not have an effect. -
hashCode
public int hashCode() -
equals
-
nodeName
-
nodeProperties
The values of all the properties that are important to thisNode. -
nodeString
-
nodeString
- Parameters:
sb- target for the stringformat- configuration for rendering the string representation
-
toString
-
toString
-
propertiesToString
protected void propertiesToString(StringBuilder sb, boolean skipIfChild, Node.NodeStringFormat format)
-