- All Known Implementing Classes:
E_Add,E_AdjustToTimezone,E_BNode.BNode0,E_BNode.BNode1,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_EBV,E_Equals,E_Exists,E_Function,E_GreaterThan,E_GreaterThanOrEqual,E_HasLang,E_HasLangDir,E_If,E_IRI,E_IRI2,E_IsBlank,E_IsIRI,E_IsLiteral,E_IsNumeric,E_IsTriple,E_IsURI,E_Lang,E_LangDir,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_SameValue,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_StrLangDir,E_StrLength,E_StrLowerCase,E_StrReplace,E_StrStartsWith,E_StrSubstring,E_StrUpperCase,E_StrUUID,E_Subtract,E_TripleFn,E_TripleObject,E_TriplePredicate,E_TripleSubject,E_UnaryMinus,E_UnaryPlus,E_URI,E_URI2,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,NodeValueLangDir,NodeValueNode,NodeValueSortKey,NodeValueString
public interface Expr
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Expr -
Method Summary
Modifier and TypeMethodDescriptionapplyNodeTransform(NodeTransform transform) Rewrite, applying a node->node transformationasVar()Convert to a Var variable.copySubstitute(Binding binding) Deep copy with substitutiondeepCopy()Deep copybooleanbooleanGeneral equality operation - consider this to be 'protected'booleanequalsBySyntax(Expr other) eval(Binding binding, FunctionEnv env) Evaluate this expression against the bindingNodeValue constant (returns null if not a constant)Variable (or null)Get the function (returns null if not a function)Variable name (returns null if not a variable)Variables used by this expression.inthashCode()Exprare used in both syntax and algebra.booleanAnswer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constantbooleanAnswer whether this is a function.booleanisSatisfied(Binding binding, FunctionEnv execCxt) Test whether a constraint is satisfied, given a set of bindings.booleanAnswer whether this is a variable.voidvisit(ExprVisitor visitor)
-
Field Details
-
NONE
-
CMP_GREATER
static final int CMP_GREATER- See Also:
-
CMP_EQUAL
static final int CMP_EQUAL- See Also:
-
CMP_LESS
static final int CMP_LESS- See Also:
-
CMP_UNEQUAL
static final int CMP_UNEQUAL- See Also:
-
CMP_INDETERMINATE
static final int CMP_INDETERMINATE- See Also:
-
-
Method Details
-
isSatisfied
Test whether a constraint is satisfied, given a set of bindings. Includes error propagation and Effective Boolean Value rules. This method does not throwExprEvalException. This function supports FILTER. Expression errors cause a result of false.- Parameters:
binding- The bindingsexecCxt- FunctionEnv- Returns:
- true or false
-
getVarsMentioned
Variables used by this expression. -
eval
Evaluate this expression against the binding- Parameters:
binding-env-
-
copySubstitute
Deep copy with substitution -
applyNodeTransform
Rewrite, applying a node->node transformation -
deepCopy
Expr deepCopy()Deep copy -
isVariable
boolean isVariable()Answer whether this is a variable. -
getVarName
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
-
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 algebra).Hence, different
hashCode=> notequalsBySyntax. -
equals
-
equalsBySyntax
-
equals
General equality operation - consider this to be 'protected'
-