org.eclipse.rdf4j.sail.federation.algebra

## Class AbstractNaryOperator<Expr extends QueryModelNode>

- java.lang.Object
- - org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode
  - - org.eclipse.rdf4j.sail.federation.algebra.AbstractNaryOperator<Expr>

- All Implemented Interfaces:
    Serializable, Cloneable, GraphPatternGroupable, QueryModelNode, VariableScopeChange
  Direct Known Subclasses:
    AbstractNaryTupleOperator

      public abstract class AbstractNaryOperator<Expr extends QueryModelNode>
      extends AbstractQueryModelNode

  An abstract superclass for operators which have (zero or more) arguments.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractNaryOperator()`
    `AbstractNaryOperator(Expr... args)` Creates a new n-ary operator.
    `AbstractNaryOperator(List<? extends Expr> args)` Creates a new n-ary operator.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addArg(Expr arg)` Sets the arguments of this n-ary operator.
    `AbstractNaryOperator<Expr>` | `clone()` Returns a (deep) clone of this query model node.
    `Expr` | `getArg(int idx)` Gets the `idx`-th argument of this n-ary operator.
    `List<? extends Expr>` | `getArgs()` Gets the arguments of this n-ary operator.
    `int` | `getNumberOfArguments()` Gets the number of arguments of this n-ary operator.
    `boolean` | `removeArg(Expr arg)`
    `void` | `replaceChildNode(QueryModelNode current, QueryModelNode replacement)` Default implementation of `QueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode)` that throws an `IllegalArgumentException` indicating that `current` is not a child node of this node.
    `protected void` | `setArg(int idx, Expr arg)` Sets the `idx`-th argument of this n-ary tuple operator.
    `<X extends Exception> void` | `visitChildren(QueryModelVisitor<X> visitor)` Dummy implementation of `QueryModelNode.visitChildren(org.eclipse.rdf4j.query.algebra.QueryModelVisitor<X>)` that does nothing.

    - ### Methods inherited from class org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode

      `getCostEstimate, getParentNode, getResultSizeActual, getResultSizeEstimate, getSignature, getTotalTimeNanosActual, isGraphPatternGroup, isVariableScopeChange, nullEquals, replaceNodeInList, replaceWith, setCostEstimate, setGraphPatternGroup, setParentNode, setResultSizeActual, setResultSizeEstimate, setTotalTimeNanosActual, setVariableScopeChange, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.query.algebra.QueryModelNode

      `equals, visit`

- - ### Constructor Detail

    - #### AbstractNaryOperator

          public AbstractNaryOperator()

    - #### AbstractNaryOperator

          public AbstractNaryOperator(Expr... args)

      Creates a new n-ary operator.

    - #### AbstractNaryOperator

          public AbstractNaryOperator(List<? extends Expr> args)

      Creates a new n-ary operator.

  - ### Method Detail

    - #### getArgs

          public List<? extends Expr> getArgs()

      Gets the arguments of this n-ary operator.
      Returns:
        A copy of the current argument list.

    - #### getNumberOfArguments

          public int getNumberOfArguments()

      Gets the number of arguments of this n-ary operator.
      Returns:
        The number of arguments.

    - #### getArg

          public Expr getArg(int idx)

      Gets the `idx`-th argument of this n-ary operator.
      Returns:
        The operator's arguments.

    - #### addArg

          public final void addArg(Expr arg)

      Sets the arguments of this n-ary operator.

    - #### setArg

          protected final void setArg(int idx,
                                      Expr arg)

      Sets the `idx`-th argument of this n-ary tuple operator.

    - #### removeArg

          public boolean removeArg(Expr arg)

    - #### visitChildren

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

      Description copied from class: `AbstractQueryModelNode`
      Dummy implementation of `QueryModelNode.visitChildren(org.eclipse.rdf4j.query.algebra.QueryModelVisitor<X>)` that does nothing. Subclasses should override this method when they have child nodes.
      Specified by:
        `visitChildren` in interface `QueryModelNode`
      Overrides:
        `visitChildren` in class `AbstractQueryModelNode`
      Throws:
        `X extends Exception`

    - #### replaceChildNode

          public void replaceChildNode(QueryModelNode current,
                                       QueryModelNode replacement)

      Description copied from class: `AbstractQueryModelNode`
      Default implementation of `QueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode)` that throws an `IllegalArgumentException` indicating that `current` is not a child node of this node.
      Specified by:
        `replaceChildNode` in interface `QueryModelNode`
      Overrides:
        `replaceChildNode` in class `AbstractQueryModelNode`
      Parameters:
        `current` - The current child node.
        `replacement` - The new child node.

    - #### clone

          public AbstractNaryOperator<Expr> clone()

      Description copied from interface: `QueryModelNode`
      Returns a (deep) clone of this query model node. This method recursively clones the entire node tree, starting from this nodes.
      Specified by:
        `clone` in interface `QueryModelNode`
      Overrides:
        `clone` in class `AbstractQueryModelNode`
      Returns:
        A deep clone of this query model node.

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