|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.Expression net.sf.saxon.expr.BinaryExpression net.sf.saxon.expr.SingletonComparison
public class SingletonComparison
Class to handle comparisons of singletons. Unlike ValueComparison, this class converts untyped atomic values to the type of the other argument, and returns false (rather than ()) if either operand is ().
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.BinaryExpression |
---|
operand0, operand1, operator |
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, staticProperties |
Constructor Summary | |
---|---|
SingletonComparison(Expression p1,
int operator,
Expression p2,
boolean checkTypes)
Create a singleton comparison - that is, a comparison between two singleton (0:1) sequences using the general comparison semantics |
Method Summary | |
---|---|
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)
Add subclass-specific attributes to the expression tree explanation. |
AtomicComparer |
getAtomicComparer()
Get the AtomicComparer used to compare atomic values. |
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 |
boolean |
needsRuntimeComparabilityCheck()
Determine whether a run-time check is needed to check that the types of the arguments are comparable |
void |
setAtomicComparer(AtomicComparer comp)
|
Methods inherited from class net.sf.saxon.expr.BinaryExpression |
---|
computeSpecialProperties, displayOperator, equals, explain, getOperands, getOperator, hashCode, isAssociative, isCommutative, isInverse, iterateSubExpressions, optimize, promote, replaceSubExpression, setFlattened, simplify, toString, typeCheck |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.saxon.expr.ComparisonExpression |
---|
getOperands |
Constructor Detail |
---|
public SingletonComparison(Expression p1, int operator, Expression p2, boolean checkTypes)
p1
- the first operandoperator
- the operatorp2
- the second operandcheckTypes
- true if a run-time check for comparability of the operand types is neededMethod Detail |
---|
public void setAtomicComparer(AtomicComparer comp)
public AtomicComparer getAtomicComparer()
ComparisonExpression
getAtomicComparer
in interface ComparisonExpression
public int getSingletonOperator()
ComparisonExpression
getSingletonOperator
in interface ComparisonExpression
public boolean convertsUntypedToOther()
convertsUntypedToOther
in interface ComparisonExpression
public int computeCardinality()
computeCardinality
in class BinaryExpression
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public ItemType getItemType(TypeHierarchy th)
getItemType
in class Expression
th
- the type hierarchy cache
public Expression copy()
copy
in class Expression
public boolean needsRuntimeComparabilityCheck()
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface EvaluableItem
evaluateItem
in class Expression
context
- the given context for evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionpublic boolean effectiveBooleanValue(XPathContext context) throws XPathException
effectiveBooleanValue
in class Expression
context
- the given context for evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionprotected void explainExtraAttributes(ExpressionPresenter out)
BinaryExpression
explainExtraAttributes
in class BinaryExpression
out
- the output destination for the displayed expression tree
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |