Package org.basex.query.expr
Class Preds
java.lang.Object
org.basex.query.expr.ExprInfo
org.basex.query.expr.Expr
org.basex.query.expr.ParseExpr
org.basex.query.expr.Arr
org.basex.query.expr.Preds
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompiles and optimizes the expression, assigns types and cardinalities.final ExprflattenEbv(Expr root, boolean ebv, CompileContext cc) Flattens predicates for boolean evaluation.booleanChecks if inlining is possible.protected final booleanmatch(Item item, QueryContext qc) Checks if the specified item matches the predicates.booleanChecks if at least one of the predicates may be positional.protected static booleanChecks if the specified expression returns an empty sequence or a deterministic numeric value.voidplan(QueryString qs) Creates a query string.protected final booleansimplify(CompileContext cc, Expr root) Simplifies all predicates.protected abstract voidAssigns the expression type.Methods inherited from class org.basex.query.expr.Arr
accept, allAreValues, args, checkUp, copyAll, count, equals, exprSize, flatten, has, inline, inline, mayBePositional, plan, simplifyAllMethods inherited from class org.basex.query.expr.ParseExpr
adoptType, atomValue, checkAllUp, checkNoEmpty, checkNoEmpty, checkNoneUp, checkNoUp, checkType, checkType, checkUp, copyType, ctxValue, ebv, item, iter, refineType, seqType, size, test, toArray, toArray, toAtomItem, toB64, toB64, toBin, toBin, toBoolean, toBoolean, toBytes, toBytes, toDouble, toDouble, toElem, toFloat, toFunc, toItem, toItem, toLong, toLong, toMap, toMap, toNode, toNode, toNodeOrNull, toNumber, toNumberOrNull, toQNm, toQNm, toToken, toToken, toTokenOrNull, toZeroToken, valueMethods inherited from class org.basex.query.expr.Expr
arg, atomItem, atomIter, copy, data, data, ddo, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimize, simplifyFor, typeCheck, uses, vacuous, visitAllMethods inherited from class org.basex.query.expr.ExprInfo
description, toErrorString, toString
-
Constructor Details
-
Preds
Constructor.- Parameters:
info- input infoseqType- sequence typepreds- predicates
-
-
Method Details
-
compile
Description copied from class:ExprCompiles and optimizes the expression, assigns types and cardinalities.- Overrides:
compilein classArr- Parameters:
cc- compilation context- Returns:
- optimized expression
- Throws:
QueryException- query exception
-
type
Assigns the expression type.- Parameters:
expr- root expression
-
match
Checks if the specified item matches the predicates.- Parameters:
item- item to be checkedqc- query context- Returns:
- result of check
- Throws:
QueryException- query exception
-
simplify
Simplifies all predicates.- Parameters:
cc- compilation contextroot- root expression- Returns:
trueif evaluation can be skipped- Throws:
QueryException- query exception
-
flattenEbv
Flattens predicates for boolean evaluation. Drops solitary context values, flattens nested predicates.- Parameters:
root- root expressionebv- EBV checkcc- compilation context- Returns:
- optimized or original expression
- Throws:
QueryException- query exception
-
numeric
Checks if the specified expression returns an empty sequence or a deterministic numeric value.- Parameters:
expr- expression- Returns:
- result of check
-
mayBePositional
public boolean mayBePositional()Checks if at least one of the predicates may be positional.- Returns:
- result of check
-
inlineable
Description copied from class:ExprChecks if inlining is possible. This function is called byInlineContext.inlineable(org.basex.query.expr.Expr...)and:CNode.inlineable(org.basex.query.InlineContext)returns false if the new expression construct new nodes. The following tests might reject inlining if the expression is a context reference:- Overrides:
inlineablein classArr- Parameters:
ic- inlining context- Returns:
- result of check
-
plan
Description copied from class:ExprInfoCreates a query string.
-