net.sf.saxon.expr
public class GeneralComparison extends BinaryExpression implements ComparisonExpression
Field Summary | |
---|---|
protected AtomicComparer | comparer |
protected int | singletonOperator |
Constructor Summary | |
---|---|
GeneralComparison(Expression p0, int op, Expression p1)
Create a relational expression identifying the two operands and the operator
|
Method Summary | |
---|---|
protected static boolean | compare(AtomicValue a1, int operator, AtomicValue a2, AtomicComparer comparer, boolean checkTypes, 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. |
boolean | effectiveBooleanValue(XPathContext context)
Evaluate the expression in a boolean context
|
Item | evaluateItem(XPathContext context)
Evaluate the expression in a given context
|
protected void | explainExtraAttributes(ExpressionPresenter out) |
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
|
Parameters: p0 the left-hand operand op the operator, as a token returned by the Tokenizer (e.g. Token.LT) p1 the right-hand operand
Parameters: a1 the first value operator the operator, for example EQUALS a2 the second value comparer the comparer to be used to perform the comparison checkTypes set to true if the operand types need to be checked for comparability at runtime context the XPath evaluation context @return true if the comparison succeeds
Returns: true if untyped values should be converted to the type of the other operand, false if they should be converted to strings.
Returns: the copy of the original expression
Parameters: context the given context for evaluation
Returns: a boolean representing the result of the numeric comparison of the two operands
Parameters: context the given context for evaluation
Returns: a BooleanValue representing the result of the numeric comparison of the two operands
Parameters: th the type hierarchy cache
Returns: the value BuiltInAtomicType.BOOLEAN
Returns: the checked expression
Returns: the checked expression