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 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 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 ofQueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode)
that throws anIllegalArgumentException
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>
voidvisitChildren(QueryModelVisitor<X> visitor)
Dummy implementation ofQueryModelNode.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
-
-
-
-
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 ofQueryModelNode.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 interfaceQueryModelNode
- Overrides:
visitChildren
in classAbstractQueryModelNode
- Throws:
X extends Exception
-
replaceChildNode
public void replaceChildNode(QueryModelNode current, QueryModelNode replacement)
Description copied from class:AbstractQueryModelNode
Default implementation ofQueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode)
that throws anIllegalArgumentException
indicating that current is not a child node of this node.- Specified by:
replaceChildNode
in interfaceQueryModelNode
- Overrides:
replaceChildNode
in classAbstractQueryModelNode
- 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 interfaceQueryModelNode
- Overrides:
clone
in classAbstractQueryModelNode
- Returns:
- A deep clone of this query model node.
-
-