org.eclipse.rdf4j.query.algebra

## Interface QueryModelNode

- All Superinterfaces:
    Cloneable, Serializable
  All Known Subinterfaces:
    AggregateOperator, ExclusiveTupleExpr, ExclusiveTupleExprRenderer, FedXTupleExpr, FilterValueExpr, StatementTupleExpr, TupleExpr, UpdateExpr, ValueExpr
  All Known Implementing Classes:
    AbstractAggregateOperator, AbstractNaryOperator, AbstractNaryTupleOperator, AbstractQueryModelNode, Add, AggregateOperatorBase, And, ArbitraryLengthPath, Avg, BinaryTupleOperator, BinaryValueOperator, BindingSetAssignment, BNodeGenerator, Bound, BoundFiltersNode, CheckStatementPattern, Clear, Coalesce, Compare, CompareAll, CompareAny, CompareSubQueryValueOperator, ConjunctiveFilterExpr, Copy, Count, Create, Datatype, DeleteData, DescribeOperator, Difference, Distinct, EmptyNJoin, EmptyNUnion, EmptySet, EmptyStatementPattern, ExclusiveArbitraryLengthPath, ExclusiveGroup, ExclusiveStatement, Exists, Extension, ExtensionElem, ExternalSet, FedXLeftJoin, FedXService, FedXStatementPattern, Filter, FilterExpr, FunctionCall, Group, GroupConcat, GroupElem, If, In, InsertData, Intersection, IRIFunction, IsBNode, IsLiteral, IsNumeric, IsResource, IsURI, Join, Label, Lang, LangMatches, LeftJoin, Like, ListMemberOperator, Load, LocalName, MathExpr, Max, Min, Modify, Move, MultiProjection, Namespace, NaryJoin, NAryValueOperator, NJoin, Not, NTuple, NUnion, Or, Order, OrderElem, OwnedTupleExpr, PassThroughTupleExpr, PrecompiledQueryNode, Projection, ProjectionElem, ProjectionElemList, QueryModelNodeBase, QueryRoot, Reduced, Regex, SameTerm, Sample, Service, SingleSourceQuery, SingletonSet, Slice, StatementPattern, StatementSource, StatementSourcePattern, Str, SubQueryValueOperator, Sum, TripleRef, TrueStatementPattern, TupleFunctionCall, UnaryTupleOperator, UnaryValueOperator, Union, ValueConstant, ValueExprTripleRef, Var, ZeroLengthPath

      public interface QueryModelNode
      extends Cloneable, Serializable

  Main interface for all query model nodes.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `QueryModelNode` | `clone()` Returns a (deep) clone of this query model node.
    `boolean` | `equals(Object o)` Returns `true` if this query model node and its children are recursively equal to `o` and its children.
    `default double` | `getCostEstimate()`
    `QueryModelNode` | `getParentNode()` Gets the node's parent.
    `default long` | `getResultSizeActual()`
    `default double` | `getResultSizeEstimate()` Returns the number of tuples that this QueryNode predicts will be outputted.
    `String` | `getSignature()` Returns the signature of this query model node.
    `default long` | `getTotalTimeNanosActual()`
    `void` | `replaceChildNode(QueryModelNode current, QueryModelNode replacement)` Replaces one of the child nodes with a new node.
    `void` | `replaceWith(QueryModelNode replacement)` Substitutes this node with a new node in the query model tree.
    `default void` | `setCostEstimate(double costEstimate)`
    `void` | `setParentNode(QueryModelNode parent)` Sets the node's parent.
    `default void` | `setResultSizeActual(long resultSizeActual)`
    `default void` | `setResultSizeEstimate(double rows)`
    `default void` | `setTotalTimeNanosActual(long totalTime)`
    `String` | `toString()` Returns an indented print of the node tree, starting from this node.
    `<X extends Exception> void` | `visit(QueryModelVisitor<X> visitor)` Visits this node.
    `<X extends Exception> void` | `visitChildren(QueryModelVisitor<X> visitor)` Visits the children of this node.

- - ### Method Detail

    - #### visit

          <X extends Exception> void visit(QueryModelVisitor<X> visitor)
                                    throws X extends Exception

      Visits this node. The node reports itself to the visitor with the proper runtime type.
      Throws:
        `X extends Exception`

    - #### visitChildren

          <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor)
                                            throws X extends Exception

      Visits the children of this node. The node calls `visit(QueryModelVisitor)` on all of its child nodes.
      Throws:
        `X extends Exception`

    - #### getParentNode

          QueryModelNode getParentNode()

      Gets the node's parent.
      Returns:
        The parent node, if any.

    - #### setParentNode

          void setParentNode(QueryModelNode parent)

      Sets the node's parent.
      Parameters:
        `parent` - The parent node for this node.

    - #### replaceChildNode

          void replaceChildNode(QueryModelNode current,
                                QueryModelNode replacement)

      Replaces one of the child nodes with a new node.
      Parameters:
        `current` - The current child node.
        `replacement` - The new child node.
      Throws:
        `IllegalArgumentException` - If `current` is not one of node's children.
        `ClassCastException` - If `replacement` is of an incompatible type.

    - #### replaceWith

          void replaceWith(QueryModelNode replacement)

      Substitutes this node with a new node in the query model tree.
      Parameters:
        `replacement` - The new node.
      Throws:
        `IllegalStateException` - If this node does not have a parent node.
        `ClassCastException` - If `replacement` is of an incompatible type.

    - #### equals

          boolean equals(Object o)

      Returns `true` if this query model node and its children are recursively equal to `o` and its children.
      Overrides:
        `equals` in class `Object`

    - #### toString

          String toString()

      Returns an indented print of the node tree, starting from this node.
      Overrides:
        `toString` in class `Object`

    - #### getSignature

          String getSignature()

      Returns the signature of this query model node. Signatures normally include the node's name and any parameters, but not parent or child nodes. This method is used by `toString()`.
      Returns:
        The node's signature, e.g. `SLICE (offset=10, limit=10)`.

    - #### clone

          QueryModelNode clone()

      Returns a (deep) clone of this query model node. This method recursively clones the entire node tree, starting from this nodes.
      Returns:
        A deep clone of this query model node.

    - #### getResultSizeEstimate

          @Experimental
          default double getResultSizeEstimate()

      Returns the number of tuples that this QueryNode predicts will be outputted. For a StatementPattern this would be the estimated cardinality provided by the EvaluationStatistics. For a Join the would be the resulting number of joined tuples.
      Returns:
        rows

    - #### setResultSizeEstimate

          @Experimental
          default void setResultSizeEstimate(double rows)

    - #### getResultSizeActual

          @Experimental
          default long getResultSizeActual()

    - #### setResultSizeActual

          @Experimental
          default void setResultSizeActual(long resultSizeActual)

    - #### getCostEstimate

          @Experimental
          default double getCostEstimate()

    - #### setCostEstimate

          @Experimental
          default void setCostEstimate(double costEstimate)

    - #### getTotalTimeNanosActual

          @Experimental
          default long getTotalTimeNanosActual()

    - #### setTotalTimeNanosActual

          @Experimental
          default void setTotalTimeNanosActual(long totalTime)

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.