public class CmpG extends Cmp
Modifier and Type | Class and Description |
---|---|
static class |
CmpG.OpG
Comparators.
|
Constructor and Description |
---|
CmpG(Expr expr1,
Expr expr2,
CmpG.OpG op,
Collation coll,
StaticContext sc,
InputInfo info)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
CmpG |
copy(CompileContext cc,
IntObjMap<Var> vm)
Copies an expression.
|
String |
description()
Returns a string description of the expression.
|
boolean |
equals(Object obj)
This function is e.g.
|
boolean |
indexAccessible(IndexInfo ii)
Checks if an expression can be rewritten to an index access.
|
CmpG |
invert()
If possible, returns an expression with inverted operands.
|
Bln |
item(QueryContext qc,
InputInfo ii)
Evaluates the expression and returns the resulting item,
or
Empty.VALUE if the expression yields an empty sequence. |
Expr |
mergeEbv(Expr expr,
boolean or,
CompileContext cc)
Tries to merge two expressions that are part of an EBV test.
|
Expr |
optimize(CompileContext cc)
Optimizes an already compiled expression without recompiling its sub-expressions.
|
CmpV.OpV |
opV()
Returns the value operator of the expression.
|
void |
plan(QueryPlan plan)
Creates a query plan.
|
void |
plan(QueryString qs)
Creates a query string.
|
accept, allAreValues, args, checkUp, compile, copyAll, count, exprSize, flatten, has, inline, inline, inlineable, mayBePositional, simplifyAll
adoptType, atomValue, checkAllUp, checkNoEmpty, checkNoEmpty, checkNoneUp, checkNoUp, checkType, checkType, checkUp, copyType, ctxValue, ebv, 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, value
arg, atomItem, atomIter, data, data, ddo, funcType, hasFreeVars, isSimple, markTailCalls, simplifyFor, typeCheck, uses, vacuous, visitAll
toErrorString, toString
public final Expr optimize(CompileContext cc) throws QueryException
Expr
optimize
in class Expr
cc
- compilation contextQueryException
- query exceptionpublic Bln item(QueryContext qc, InputInfo ii) throws QueryException
Expr
Empty.VALUE
if the expression yields an empty sequence.
If this method is not implemented, Expr.value(QueryContext)
must be implemented instead.item
in class ParseExpr
qc
- query contextii
- input info (only required by Seq
instances, which have no input info)Empty.VALUE
QueryException
- query exceptionpublic final CmpG invert()
Cmp
public final CmpV.OpV opV()
Cmp
public Expr mergeEbv(Expr expr, boolean or, CompileContext cc) throws QueryException
Expr
And
, Or
), Step
and Filter
.
Overwritten by CmpG
, CmpIR
, CmpR
, CmpSR
,
ItrPos
, Pos
and others.mergeEbv
in class Expr
expr
- second expressionor
- union or intersectioncc
- compilation contextnull
QueryException
- query exceptionpublic final boolean indexAccessible(IndexInfo ii) throws QueryException
Expr
IndexInfo.expr
.
This method will be called by the Path
expression.indexAccessible
in class Expr
ii
- index infoQueryException
- query exceptionpublic CmpG copy(CompileContext cc, IntObjMap<Var> vm)
Expr
VarRef.inline(org.basex.query.InlineContext)
, FuncItem.inline(org.basex.query.expr.Expr[], org.basex.query.CompileContext)
,
Closure.inline(org.basex.query.InlineContext)
and StaticFunc.inline(org.basex.query.expr.Expr[], org.basex.query.CompileContext)
.copy
in class Expr
cc
- compilation contextvm
- mapping from old variable IDs to new variable copies.
Required by Closure.copy(org.basex.query.CompileContext, org.basex.util.hash.IntObjMap<org.basex.query.var.Var>)
and VarRef.copy(org.basex.query.CompileContext, org.basex.util.hash.IntObjMap<org.basex.query.var.Var>)
public final boolean equals(Object obj)
Arr
If.optimize(CompileContext)
, Switch.optimize(CompileContext)
,
Typeswitch.optimize(CompileContext)
, in order to discard identical expressions.
CmpR.mergeEbv(Expr, boolean, CompileContext)
or
CmpSR.mergeEbv(Expr, boolean, CompileContext)
,
in order to merge expressions with identical input.
optimize(CompileContext)
or CmpV.optimize(CompileContext)
,
in order to pre-evaluate equality tests.
optimize(CompileContext)
or
Pos.get(Expr, CmpV.OpV, InputInfo, CompileContext)
,
in order to compare the start and end value.
PathCache
, in order to find identical root values at runtime.
public String description()
ExprInfo
ExprInfo.toString()
method,
arguments are not included in the output.description
in class ExprInfo
public final void plan(QueryPlan plan)
ExprInfo
public final void plan(QueryString qs)
ExprInfo
Copyright © 2005–2023 BaseX Team. All rights reserved.