Package org.apache.jena.sparql.expr
Interface Expr
-
- All Known Implementing Classes:
E_Add
,E_BNode
,E_Bound
,E_Call
,E_Cast
,E_Coalesce
,E_Conditional
,E_Datatype
,E_DateTimeDay
,E_DateTimeHours
,E_DateTimeMinutes
,E_DateTimeMonth
,E_DateTimeSeconds
,E_DateTimeTimezone
,E_DateTimeTZ
,E_DateTimeYear
,E_Divide
,E_Equals
,E_Exists
,E_Function
,E_FunctionDynamic
,E_GreaterThan
,E_GreaterThanOrEqual
,E_IRI
,E_IsBlank
,E_IsIRI
,E_IsLiteral
,E_IsNumeric
,E_IsTriple
,E_IsURI
,E_Lang
,E_LangMatches
,E_LessThan
,E_LessThanOrEqual
,E_LogicalAnd
,E_LogicalNot
,E_LogicalOr
,E_MD5
,E_Multiply
,E_NotEquals
,E_NotExists
,E_NotOneOf
,E_Now
,E_NumAbs
,E_NumCeiling
,E_NumFloor
,E_NumRound
,E_OneOf
,E_OneOfBase
,E_OpNumericIntegerDivide
,E_OpNumericMod
,E_Random
,E_Regex
,E_SameTerm
,E_SHA1
,E_SHA224
,E_SHA256
,E_SHA384
,E_SHA512
,E_Str
,E_StrAfter
,E_StrBefore
,E_StrConcat
,E_StrContains
,E_StrDatatype
,E_StrEncodeForURI
,E_StrEndsWith
,E_StrLang
,E_StrLength
,E_StrLowerCase
,E_StrReplace
,E_StrStartsWith
,E_StrSubstring
,E_StrUpperCase
,E_StrUUID
,E_Subtract
,E_TripleObject
,E_TriplePredicate
,E_TripleSubject
,E_TripleTerm
,E_UnaryMinus
,E_UnaryPlus
,E_URI
,E_UUID
,E_Version
,ExprAggregator
,ExprDigest
,ExprFunction
,ExprFunction0
,ExprFunction1
,ExprFunction2
,ExprFunction3
,ExprFunctionN
,ExprFunctionOp
,ExprNode
,ExprNone
,ExprSystem
,ExprTripleTerm
,ExprVar
,NodeValue
,NodeValueBoolean
,NodeValueDateTime
,NodeValueDecimal
,NodeValueDouble
,NodeValueDuration
,NodeValueFloat
,NodeValueInteger
,NodeValueLang
,NodeValueNode
,NodeValueSortKey
,NodeValueString
public interface Expr
-
-
Field Summary
Fields Modifier and Type Field Description static int
CMP_EQUAL
static int
CMP_GREATER
static int
CMP_INDETERMINATE
static int
CMP_LESS
static int
CMP_UNEQUAL
static Expr
NONE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Expr
applyNodeTransform(NodeTransform transform)
Rewrite, applying a node->node transformationVar
asVar()
Convert to a Var variable.Expr
copySubstitute(Binding binding)
Deep copy with substitutionExpr
deepCopy()
Deep copyboolean
equals(java.lang.Object other)
boolean
equals(Expr other, boolean bySyntax)
General equality operation - consider this to be 'protected'boolean
equalsBySyntax(Expr other)
NodeValue
eval(Binding binding, FunctionEnv env)
Evaluate this expression against the bindingNodeValue
getConstant()
NodeValue constant (returns null if not a constant)ExprVar
getExprVar()
Variable (or null)ExprFunction
getFunction()
Get the function (returns null if not a function)java.lang.String
getVarName()
Variable name (returns null if not a variable)java.util.Set<Var>
getVarsMentioned()
Variables used by this expression.int
hashCode()
Expr
are used in both syntax and algebra.boolean
isConstant()
Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constantboolean
isFunction()
Answer whether this is a function.boolean
isSatisfied(Binding binding, FunctionEnv execCxt)
Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.boolean
isVariable()
Answer whether this is a variable.void
visit(ExprVisitor visitor)
-
-
-
Field Detail
-
NONE
static final Expr NONE
-
CMP_GREATER
static final int CMP_GREATER
- See Also:
- Constant Field Values
-
CMP_EQUAL
static final int CMP_EQUAL
- See Also:
- Constant Field Values
-
CMP_LESS
static final int CMP_LESS
- See Also:
- Constant Field Values
-
CMP_UNEQUAL
static final int CMP_UNEQUAL
- See Also:
- Constant Field Values
-
CMP_INDETERMINATE
static final int CMP_INDETERMINATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSatisfied
boolean isSatisfied(Binding binding, FunctionEnv execCxt)
Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.- Parameters:
binding
- The bindingsexecCxt
- FunctionEnv- Returns:
- true or false
-
getVarsMentioned
java.util.Set<Var> getVarsMentioned()
Variables used by this expression.
-
eval
NodeValue eval(Binding binding, FunctionEnv env)
Evaluate this expression against the binding- Parameters:
binding
-env
-
-
applyNodeTransform
Expr applyNodeTransform(NodeTransform transform)
Rewrite, applying a node->node transformation
-
deepCopy
Expr deepCopy()
Deep copy
-
isVariable
boolean isVariable()
Answer whether this is a variable.
-
getVarName
java.lang.String getVarName()
Variable name (returns null if not a variable)
-
getExprVar
ExprVar getExprVar()
Variable (or null)
-
asVar
Var asVar()
Convert to a Var variable.
-
isConstant
boolean isConstant()
Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constant
-
getConstant
NodeValue getConstant()
NodeValue constant (returns null if not a constant)
-
isFunction
boolean isFunction()
Answer whether this is a function.
-
getFunction
ExprFunction getFunction()
Get the function (returns null if not a function)
-
visit
void visit(ExprVisitor visitor)
-
hashCode
int hashCode()
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
andEXISTS
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
andequals
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
impliesequals
(by alegbra).Hence, different
hashCode
=> notequalsBySyntax
.
- Overrides:
hashCode
in classjava.lang.Object
-
equals
boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
equalsBySyntax
boolean equalsBySyntax(Expr other)
-
equals
boolean equals(Expr other, boolean bySyntax)
General equality operation - consider this to be 'protected'
-
-