Package org.eclipse.rdf4j.query.algebra
Class AbstractQueryModelNode
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode
-
- All Implemented Interfaces:
Serializable,Cloneable,GraphPatternGroupable,QueryModelNode,VariableScopeChange
- Direct Known Subclasses:
Add,ArbitraryLengthPath,BinaryTupleOperator,BinaryValueOperator,BindingSetAssignment,BNodeGenerator,Bound,BoundFiltersNode,Clear,ConjunctiveFilterExpr,Copy,Create,DeleteData,EmptySet,ExclusiveGroup,ExtensionElem,FedXService,FilterExpr,FunctionCall,GroupElem,HolderNode,If,InsertData,Load,Modify,Move,NAryValueOperator,NTuple,OrderElem,PassThroughTupleExpr,ProjectionElem,ProjectionElemList,QueryModelNodeBase,SingleSourceQuery,SingletonSet,StatementPattern,StatementSource,SubQueryValueOperator,TripleRef,UnaryTupleOperator,UnaryValueOperator,ValueConstant,ValueExprTripleRef,Var,ZeroLengthPath
public abstract class AbstractQueryModelNode extends Object implements QueryModelNode, VariableScopeChange, GraphPatternGroupable
Base implementation ofQueryModelNode.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractQueryModelNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AbstractQueryModelNodeclone()Returns a (deep) clone of this query model node.doublegetCardinality()doublegetCostEstimate()QueryModelNodegetParentNode()Gets the node's parent.longgetResultSizeActual()doublegetResultSizeEstimate()Returns the number of tuples that this QueryNode predicts will be outputted.StringgetSignature()Default implementation ofQueryModelNode.getSignature()that prints the name of the node's class.longgetTotalTimeNanosActual()booleanisCardinalitySet()booleanisGraphPatternGroup()Deprecated.booleanisVariableScopeChange()indicates if the node represents a variable scope change.protected booleannullEquals(Object o1, Object o2)voidreplaceChildNode(QueryModelNode current, QueryModelNode replacement)Default implementation ofQueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode)that throws anIllegalArgumentExceptionindicating that current is not a child node of this node.protected <T extends QueryModelNode>
booleanreplaceNodeInList(List<T> list, QueryModelNode current, QueryModelNode replacement)voidreplaceWith(QueryModelNode replacement)Default implementation ofQueryModelNode.replaceWith(QueryModelNode)that throws anIllegalArgumentExceptionindicating that current is not a child node of this node.voidresetCardinality()voidsetCardinality(double cardinality)voidsetCostEstimate(double costEstimate)voidsetGraphPatternGroup(boolean isGraphPatternGroup)Deprecated.voidsetParentNode(QueryModelNode parent)Sets the node's parent.voidsetResultSizeActual(long resultSizeActual)voidsetResultSizeEstimate(double resultSizeEstimate)voidsetTotalTimeNanosActual(long totalTimeNanosActual)voidsetVariableScopeChange(boolean isVariableScopeChange)Set the value ofVariableScopeChange.isVariableScopeChange()to true or false.protected booleanshouldCacheCardinality()StringtoString()Returns an indented print of the node tree, starting from this node.<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 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
-
getParentNode
public QueryModelNode getParentNode()
Description copied from interface:QueryModelNodeGets the node's parent.- Specified by:
getParentNodein interfaceQueryModelNode- Returns:
- The parent node, if any.
-
setParentNode
public void setParentNode(QueryModelNode parent)
Description copied from interface:QueryModelNodeSets the node's parent.- Specified by:
setParentNodein interfaceQueryModelNode- Parameters:
parent- The parent node for this node.
-
isVariableScopeChange
public boolean isVariableScopeChange()
Description copied from interface:VariableScopeChangeindicates if the node represents a variable scope change.- Specified by:
isVariableScopeChangein interfaceVariableScopeChange- Returns:
- true iff the node represents a variable scope change.
-
setVariableScopeChange
public void setVariableScopeChange(boolean isVariableScopeChange)
Description copied from interface:VariableScopeChangeSet the value ofVariableScopeChange.isVariableScopeChange()to true or false.- Specified by:
setVariableScopeChangein interfaceVariableScopeChange
-
isGraphPatternGroup
@Deprecated public boolean isGraphPatternGroup()
Deprecated.Description copied from interface:GraphPatternGroupableindicates if the node represents the root of a graph pattern group.- Specified by:
isGraphPatternGroupin interfaceGraphPatternGroupable- Returns:
- true iff the node represents the node of a graph pattern group.
-
setGraphPatternGroup
@Deprecated public void setGraphPatternGroup(boolean isGraphPatternGroup)
Deprecated.Description copied from interface:GraphPatternGroupableSet the value ofGraphPatternGroupable.isGraphPatternGroup()to true or false.- Specified by:
setGraphPatternGroupin interfaceGraphPatternGroupable
-
visitChildren
public <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor) throws X extends Exception
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:
visitChildrenin interfaceQueryModelNode- Throws:
X extends Exception
-
replaceChildNode
public void replaceChildNode(QueryModelNode current, QueryModelNode replacement)
Default implementation ofQueryModelNode.replaceChildNode(QueryModelNode, QueryModelNode)that throws anIllegalArgumentExceptionindicating that current is not a child node of this node.- Specified by:
replaceChildNodein interfaceQueryModelNode- Parameters:
current- The current child node.replacement- The new child node.
-
replaceWith
public void replaceWith(QueryModelNode replacement)
Default implementation ofQueryModelNode.replaceWith(QueryModelNode)that throws anIllegalArgumentExceptionindicating that current is not a child node of this node.- Specified by:
replaceWithin interfaceQueryModelNode- Parameters:
replacement- The new node.
-
getSignature
public String getSignature()
Default implementation ofQueryModelNode.getSignature()that prints the name of the node's class.- Specified by:
getSignaturein interfaceQueryModelNode- Returns:
- The node's signature, e.g. SLICE (offset=10, limit=10).
-
toString
public String toString()
Description copied from interface:QueryModelNodeReturns an indented print of the node tree, starting from this node.- Specified by:
toStringin interfaceQueryModelNode- Overrides:
toStringin classObject
-
clone
public AbstractQueryModelNode clone()
Description copied from interface:QueryModelNodeReturns a (deep) clone of this query model node. This method recursively clones the entire node tree, starting from this nodes.- Specified by:
clonein interfaceQueryModelNode- Overrides:
clonein classObject- Returns:
- A deep clone of this query model node.
-
replaceNodeInList
protected <T extends QueryModelNode> boolean replaceNodeInList(List<T> list, QueryModelNode current, QueryModelNode replacement)
-
getResultSizeEstimate
public double getResultSizeEstimate()
Description copied from interface:QueryModelNodeReturns 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.- Specified by:
getResultSizeEstimatein interfaceQueryModelNode- Returns:
- rows
-
setResultSizeEstimate
public void setResultSizeEstimate(double resultSizeEstimate)
- Specified by:
setResultSizeEstimatein interfaceQueryModelNode
-
getResultSizeActual
public long getResultSizeActual()
- Specified by:
getResultSizeActualin interfaceQueryModelNode
-
setResultSizeActual
public void setResultSizeActual(long resultSizeActual)
- Specified by:
setResultSizeActualin interfaceQueryModelNode
-
getCostEstimate
public double getCostEstimate()
- Specified by:
getCostEstimatein interfaceQueryModelNode
-
setCostEstimate
public void setCostEstimate(double costEstimate)
- Specified by:
setCostEstimatein interfaceQueryModelNode
-
getTotalTimeNanosActual
public long getTotalTimeNanosActual()
- Specified by:
getTotalTimeNanosActualin interfaceQueryModelNode
-
setTotalTimeNanosActual
public void setTotalTimeNanosActual(long totalTimeNanosActual)
- Specified by:
setTotalTimeNanosActualin interfaceQueryModelNode
-
getCardinality
@Experimental public double getCardinality()
-
setCardinality
@Experimental public void setCardinality(double cardinality)
-
resetCardinality
@Experimental public void resetCardinality()
-
isCardinalitySet
@Experimental public boolean isCardinalitySet()
-
shouldCacheCardinality
@Experimental protected boolean shouldCacheCardinality()
-
-