org.exist.xquery
Class ValueComparison
java.lang.Object
org.exist.xquery.AbstractExpression
org.exist.xquery.PathExpr
org.exist.xquery.BinaryOp
org.exist.xquery.GeneralComparison
org.exist.xquery.ValueComparison
- All Implemented Interfaces:
- CompiledXQuery, Expression, IndexUseReporter, Optimizable, RewritableExpression, org.xmldb.api.base.CompiledExpression
public class ValueComparison
- extends GeneralComparison
| Fields inherited from interface org.exist.xquery.Expression |
DOT_TEST, EXPRESSION_ID_INVALID, IGNORE_CONTEXT, IN_NODE_CONSTRUCTOR, IN_PREDICATE, IN_UPDATE, IN_WHERE_CLAUSE, NEED_INDEX_INFO, NO_CONTEXT_ID, NON_STREAMABLE, POSITIONAL_PREDICATE, SINGLE_STEP_EXECUTION, UNORDERED, USE_TREE_TRAVERSAL |
| Methods inherited from class org.exist.xquery.GeneralComparison |
accept, analyze, canOptimize, checkForQNameIndex, eval, genericCompare, getCollator, getDependencies, getOptimizeAxis, getRelation, hasUsedIndex, optimizeOnChild, optimizeOnSelf, preSelect, quickNodeSetCompare, resetState, returnsType, setCollation, simplifyOperands, switchOperands |
| Methods inherited from class org.exist.xquery.PathExpr |
add, add, addPath, addPredicate, allowMixNodesInReturn, dump, getCardinality, getColumn, getContext, getDocumentSet, getExpression, getLastExpression, getLength, getLine, getLiteralValue, getParent, getPrimaryAxis, getSubExpression, getSubExpressionCount, isValid, replaceExpression, replaceLastExpression, reset, setContext, setPrimaryAxis, setUseStaticContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.exist.xquery.Expression |
allowMixNodesInReturn, eval, getCardinality, getColumn, getContext, getContextDocSet, getContextId, getExpressionId, getLine, getParent, getPrimaryAxis, getSource, getSubExpression, getSubExpressionCount, match, needsReset, setASTNode, setContextDocSet, setContextId, setLocation, setPrimaryAxis, simplify |
ValueComparison
public ValueComparison(XQueryContext context,
int relation)
- Parameters:
context - relation -
ValueComparison
public ValueComparison(XQueryContext context,
Expression left,
Expression right,
int relation)
- Parameters:
context - left - right - relation -
genericCompare
protected Sequence genericCompare(Sequence contextSequence,
Item contextItem)
throws XPathException
- Description copied from class:
GeneralComparison
- Generic, slow implementation. Applied if none of the possible optimizations can be used.
- Overrides:
genericCompare in class GeneralComparison
- Returns:
- The Sequence resulting from the comparison
- Throws:
XPathException
nodeSetCompare
protected Sequence nodeSetCompare(NodeSet nodes,
Sequence contextSequence)
throws XPathException
- Description copied from class:
GeneralComparison
- Optimized implementation, which can be applied if the left operand returns a node set. In this case, the left expression is executed first. All
matching context nodes are then passed to the right expression.
- Overrides:
nodeSetCompare in class GeneralComparison
- Parameters:
nodes - DOCUMENT ME!contextSequence - DOCUMENT ME!
- Returns:
- DOCUMENT ME!
- Throws:
XPathException - DOCUMENT ME!
compareAtomic
public static boolean compareAtomic(java.text.Collator collator,
AtomicValue lv,
AtomicValue rv,
int truncation,
int relation)
throws XPathException
- Cast the atomic operands into a comparable type
and compare them.
- Throws:
XPathException
dump
public void dump(ExpressionDumper dumper)
- Description copied from interface:
Expression
- Write a diagnostic dump of the expression to the passed
ExpressionDumper.
- Specified by:
dump in interface Expression- Overrides:
dump in class GeneralComparison
- Parameters:
dumper - the expression dumper to write to
toString
public java.lang.String toString()
- Overrides:
toString in class GeneralComparison