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_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 intCMP_EQUALstatic intCMP_GREATERstatic intCMP_INDETERMINATEstatic intCMP_LESSstatic intCMP_UNEQUALstatic ExprNONE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExprapplyNodeTransform(NodeTransform transform)Rewrite, applying a node->node transformationVarasVar()Convert to a Var variable.ExprcopySubstitute(Binding binding)Deep copy with substitutionExprdeepCopy()Deep copybooleanequals(java.lang.Object other)booleanequals(Expr other, boolean bySyntax)General equality operation - consider this to be 'protected'booleanequalsBySyntax(Expr other)NodeValueeval(Binding binding, FunctionEnv env)Evaluate this expression against the bindingNodeValuegetConstant()NodeValue constant (returns null if not a constant)ExprVargetExprVar()Variable (or null)ExprFunctiongetFunction()Get the function (returns null if not a function)java.lang.StringgetVarName()Variable name (returns null if not a variable)java.util.Set<Var>getVarsMentioned()Variables used by this expression.inthashCode()Exprare used in both syntax and algebra.booleanisConstant()Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constantbooleanisFunction()Answer whether this is a function.booleanisSatisfied(Binding binding, FunctionEnv execCxt)Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.booleanisVariable()Answer whether this is a variable.voidvisit(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()
Exprare 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 EXISTSandEXISTSexpressions which involve a query pattern. As a result there are different ways in syntax to produce the same algebra form.Two
Exprare considered equal if they are equal as algebra expressions.hashCodeandequalsmust 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,equalsBySyntaximpliesequals(by alegbra).Hence, different
hashCode=> notequalsBySyntax.- Overrides:
hashCodein classjava.lang.Object
-
equals
boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
equalsBySyntax
boolean equalsBySyntax(Expr other)
-
equals
boolean equals(Expr other, boolean bySyntax)
General equality operation - consider this to be 'protected'
-
-