net.sf.saxon.expr
Class GeneralComparison
- ComparisonExpression, EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator
public class GeneralComparison
GeneralComparison: a boolean expression that compares two expressions
for equals, not-equals, greater-than or less-than. This implements the operators
=, !=, <, >, etc. This implementation is not used when in backwards-compatible mode
protected static boolean | compare(AtomicValue a1, int operator, AtomicValue a2, AtomicComparer comparer, XPathContext context) - Compare two atomic values
|
int | computeCardinality() - Determine the static cardinality.
|
boolean | convertsUntypedToOther() - Determine whether untyped atomic values should be converted to the type of the other operand
|
Expression | copy() - Copy an expression.
|
protected String | displayOperator()
|
boolean | effectiveBooleanValue(XPathContext context) - Evaluate the expression in a boolean context
|
Item | evaluateItem(XPathContext context) - Evaluate the expression in a given context
|
AtomicComparer | getAtomicComparer() - Get the AtomicComparer used to compare atomic values.
|
protected GeneralComparison | getInverseComparison()
|
ItemType | getItemType(TypeHierarchy th) - Determine the data type of the expression
|
int | getSingletonOperator() - Get the primitive (singleton) operator used: one of Token.FEQ, Token.FNE, Token.FLT, Token.FGT,
Token.FLE, Token.FGE
|
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) - Optimize the expression
|
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType) - Type-check the expression
|
computeCardinality , computeSpecialProperties , displayOperator , equals , explain , getOperands , getOperator , hashCode , isAssociative , isCommutative , isInverse , iterateSubExpressions , optimize , promote , replaceSubExpression , setFlattened , simplify , toString , typeCheck |
addToPathMap , adoptChildExpression , checkPermittedContents , computeCardinality , computeDependencies , computeSpecialProperties , computeStaticProperties , copy , display , doPromotion , dynamicError , effectiveBooleanValue , evaluateAsString , evaluateItem , explain , explain , findParentOf , getCardinality , getColumnNumber , getConstructType , getContainer , getDependencies , getExecutable , getHostLanguage , getImplementationMethod , getInstructionInfo , getIntrinsicDependencies , getItemType , getLineNumber , getLocationId , getLocationProvider , getPublicId , getSlotsUsed , getSpecialProperties , getSystemId , hasLoopingSubexpression , implementsStaticTypeCheck , iterate , iterateEvents , iterateSubExpressions , markTailFunctionCalls , optimize , process , promote , replaceSubExpression , resetLocalStaticProperties , setContainer , setFiltered , setFlattened , setLocationId , simplify , staticTypeCheck , suppressValidation , toString , typeCheck , typeError |
singletonOperator
protected int singletonOperator
GeneralComparison
public GeneralComparison(Expression p0,
int op,
Expression p1)
Create a relational expression identifying the two operands and the operator
p0
- the left-hand operandop
- the operator, as a token returned by the Tokenizer (e.g. Token.LT)p1
- the right-hand operand
compare
protected static boolean compare(AtomicValue a1,
int operator,
AtomicValue a2,
AtomicComparer comparer,
XPathContext context)
throws XPathException
Compare two atomic values
a1
- the first valueoperator
- the operator, for example Token.EQUALS
a2
- the second valuecomparer
- the comparer to be used to perform the comparisoncontext
- the XPath evaluation context
- true if the comparison succeeds
convertsUntypedToOther
public boolean convertsUntypedToOther()
Determine whether untyped atomic values should be converted to the type of the other operand
- convertsUntypedToOther in interface ComparisonExpression
- true if untyped values should be converted to the type of the other operand, false if they
should be converted to strings.
copy
public Expression copy()
Copy an expression. This makes a deep copy.
- copy in interface Expression
- the copy of the original expression
effectiveBooleanValue
public boolean effectiveBooleanValue(XPathContext context)
throws XPathException
Evaluate the expression in a boolean context
- effectiveBooleanValue in interface Expression
context
- the given context for evaluation
- a boolean representing the result of the numeric comparison of the two operands
getSingletonOperator
public int getSingletonOperator()
Get the primitive (singleton) operator used: one of Token.FEQ, Token.FNE, Token.FLT, Token.FGT,
Token.FLE, Token.FGE
- getSingletonOperator in interface ComparisonExpression