CMP_EQUAL, CMP_GREATER, CMP_INDETERMINATE, CMP_LESS, CMP_UNEQUAL, NONE
Constructor and Description |
---|
ExprVar(Node n) |
ExprVar(String name) |
ExprVar(Var v) |
Modifier and Type | Method and Description |
---|---|
Expr |
apply(ExprTransform transform) |
Expr |
applyNodeTransform(NodeTransform transform)
Rewrite, applying a node->node transformation
|
String |
asSparqlExpr() |
Var |
asVar()
Convert to a Var variable.
|
Expr |
copy(Var v) |
Expr |
copySubstitute(Binding binding)
Deep copy with substitution
|
boolean |
equals(Expr other,
boolean bySyntax)
General equality operation - consider this to be 'protected'
|
NodeValue |
eval(Binding binding,
FunctionEnv env)
Evaluate this expression against the binding
|
void |
format(Query query,
org.apache.jena.atlas.io.IndentedWriter out) |
Node |
getAsNode() |
ExprVar |
getExprVar()
Variable (or null)
|
String |
getVarName()
Variable name (returns null if not a variable)
|
int |
hashCode()
Expr are used in both syntax and algebra. |
boolean |
isVariable()
Answer whether this is a variable.
|
String |
toPrefixString() |
String |
toString() |
void |
visit(ExprVisitor visitor) |
deepCopy, equals, equalsBySyntax, getConstant, getExpr, getFunction, getGraphPattern, getVarNamesMentioned, getVarsMentioned, isConstant, isExpr, isFunction, isGraphPattern, isSatisfied, varNamesMentioned, varsMentioned
public ExprVar(String name)
public ExprVar(Node n)
public ExprVar(Var v)
public NodeValue eval(Binding binding, FunctionEnv env)
Expr
public Expr copySubstitute(Binding binding)
Expr
copySubstitute
in interface Expr
copySubstitute
in class ExprNode
public Expr applyNodeTransform(NodeTransform transform)
Expr
applyNodeTransform
in interface Expr
applyNodeTransform
in class ExprNode
public void visit(ExprVisitor visitor)
public Expr apply(ExprTransform transform)
public void format(Query query, org.apache.jena.atlas.io.IndentedWriter out)
public int hashCode()
Expr
Expr
are used in both syntax and algebra. There is no syntax
to algebra translation step because the parser uses operator precedence
to build the right evaluation structure directly.
The exceptions to this are the NOT EXISTS
and
EXISTS
expressions which involve a query pattern. As a
result there are different ways in syntax to produce the same algebra
form.
Two Expr
are considered equal if they are equal as algebra
expressions. hashCode
and equals
must implement
that.
There is also equalsBySyntax
. Because two different syntax
forms can yield the same algebra, but two different algebra forms
must be different syntax, equalsBySyntax
implies equals
(by alegbra).
Hence, different hashCode
=> not equalsBySyntax
.
public boolean equals(Expr other, boolean bySyntax)
Expr
public boolean isVariable()
Expr
isVariable
in interface Expr
isVariable
in class ExprNode
public String getVarName()
Expr
getVarName
in interface Expr
getVarName
in class ExprNode
public ExprVar getExprVar()
Expr
getExprVar
in interface Expr
getExprVar
in class ExprNode
public Node getAsNode()
public String toPrefixString()
public String asSparqlExpr()
Licenced under the Apache License, Version 2.0