Class Var
java.lang.Object
org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode
org.eclipse.rdf4j.query.algebra.Var
- All Implemented Interfaces:
Serializable, Cloneable, QueryModelNode, ValueExpr, VariableScopeChange
A variable that can contain a Value.
Service Provider–based construction: Prefer the Var.of(...) static factory methods over
direct constructors. These factories delegate to a Var.Provider discovered via ServiceLoader or
selected via the PROVIDER_PROPERTY system property. This allows third-party libraries to supply custom
Var subclasses without changing call sites. If no provider is found, construction falls back to
new Var(...).
To install a provider, add a file META-INF/services/org.eclipse.rdf4j.query.algebra.Var$Provider containing
the implementing class name, or set system property PROVIDER_PROPERTY to a specific provider FQCN.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceService Provider Interface for globally controllingVarinstantiation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSystem property that, when set to a fully qualified class name implementingVar.Provider, selects that provider. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, boolean)instead.Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, Value)instead.Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, Value, boolean)instead.Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, Value, boolean, boolean)instead. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a (deep) clone of this query model node.booleanReturns true if this query model node and its children are recursively equal to o and its children.getName()Default implementation ofQueryModelNode.getSignature()that prints the name of the node's class.getValue()inthashCode()booleanhasValue()booleanbooleanstatic VarFactory mirroringVar(String).static VarFactory mirroringVar(String, boolean).static VarFactory mirroringVar(String, Value).static VarFactory mirroringVar(String, Value, boolean).static VarFactory mirroringVar(String, Value, boolean, boolean).voidreplaceChildNode(QueryModelNode current, QueryModelNode replacement) Replaces one of the child nodes with a new node.voidsetParentNode(QueryModelNode parent) Sets the node's parent.protected booleanExtension hook for subclasses to participate inequals(Object)while preserving symmetry with otherVarinstances.protected intExtension hook for subclasses to contribute additional state tohashCode()while reusing the cached hash storage inVar.<X extends Exception>
voidvisit(QueryModelVisitor<X> visitor) Visits this node.<X extends Exception>
voidvisitChildren(QueryModelVisitor<X> visitor) Visits the children of this node.Methods inherited from class AbstractQueryModelNode
getCardinality, getCostEstimate, getParentNode, getResultSizeActual, getResultSizeEstimate, getTotalTimeNanosActual, isCardinalitySet, isVariableScopeChange, nullEquals, replaceNodeInList, replaceWith, resetCardinality, setCardinality, setCostEstimate, setResultSizeActual, setResultSizeEstimate, setTotalTimeNanosActual, setVariableScopeChange, shouldCacheCardinality, toStringMethods inherited from interface QueryModelNode
getCostEstimate, getParentNode, getResultSizeActual, getResultSizeEstimate, getTotalTimeNanosActual, replaceWith, setCostEstimate, setResultSizeActual, setResultSizeEstimate, setTotalTimeNanosActual, toString
-
Field Details
-
PROVIDER_PROPERTY
System property that, when set to a fully qualified class name implementingVar.Provider, selects that provider. If absent, the first provider discovered byServiceLoaderis used; if none are found, a default provider that constructsVardirectly is used.- See Also:
-
-
Constructor Details
-
Var
@Deprecated(since="5.1.5", forRemoval=true) public Var(String name, Value value, boolean anonymous, boolean constant) Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, Value, boolean, boolean)instead. Constructor will be made protected, subclasses may still use this method to instantiate themselves.- Parameters:
name-value-anonymous-constant-
-
Var
Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String)instead.- Parameters:
name-
-
Var
Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, boolean)instead.- Parameters:
name-anonymous-
-
Var
Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, Value)instead.- Parameters:
name-value-
-
Var
Deprecated, for removal: This API element is subject to removal in a future version.since 5.1.5, useof(String, Value, boolean)instead.- Parameters:
name-value-anonymous-
-
-
Method Details
-
of
Factory mirroringVar(String). -
of
Factory mirroringVar(String, boolean). -
of
Factory mirroringVar(String, Value). -
of
Factory mirroringVar(String, Value, boolean). -
of
Factory mirroringVar(String, Value, boolean, boolean). -
isAnonymous
public boolean isAnonymous() -
getName
-
hasValue
public boolean hasValue() -
getValue
-
visit
Description copied from interface:QueryModelNodeVisits this node. The node reports itself to the visitor with the proper runtime type.- Specified by:
visitin interfaceQueryModelNode- Throws:
X
-
visitChildren
Description copied from interface:QueryModelNodeVisits the children of this node. The node callsQueryModelNode.visit(QueryModelVisitor)on all of its child nodes.- Specified by:
visitChildrenin interfaceQueryModelNode- Throws:
X
-
setParentNode
Description copied from interface:QueryModelNodeSets the node's parent.- Specified by:
setParentNodein interfaceQueryModelNode- Overrides:
setParentNodein classAbstractQueryModelNode- Parameters:
parent- The parent node for this node.
-
replaceChildNode
Description copied from interface:QueryModelNodeReplaces one of the child nodes with a new node.- Specified by:
replaceChildNodein interfaceQueryModelNode- Parameters:
current- The current child node.replacement- The new child node.
-
getSignature
Description copied from class:AbstractQueryModelNodeDefault implementation ofQueryModelNode.getSignature()that prints the name of the node's class.- Specified by:
getSignaturein interfaceQueryModelNode- Overrides:
getSignaturein classAbstractQueryModelNode- Returns:
- The node's signature, e.g. SLICE (offset=10, limit=10).
-
equals
Description copied from interface:QueryModelNodeReturns true if this query model node and its children are recursively equal to o and its children.- Specified by:
equalsin interfaceQueryModelNode- Overrides:
equalsin classObject
-
hashCode
-
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- Specified by:
clonein interfaceValueExpr- Overrides:
clonein classAbstractQueryModelNode- Returns:
- A deep clone of this query model node.
-
spiEquals
Extension hook for subclasses to participate inequals(Object)while preserving symmetry with otherVarinstances. -
spiHashCode
protected int spiHashCode()Extension hook for subclasses to contribute additional state tohashCode()while reusing the cached hash storage inVar. -
isConstant
public boolean isConstant()- Returns:
- Returns the constant.
-
of(String)instead.