|
|||||||
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.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
---|---|
SingletonComparison(Expression p1,
int operator,
Expression p2)
|
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 |
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 |
void |
setAtomicComparer(AtomicComparer comp)
|
Methods inherited from class net.sf.saxon.expr.BinaryExpression |
---|
computeSpecialProperties, equals, explain, getOperands, getOperator, hashCode, iterateSubExpressions, optimize, promote, replaceSubExpression, setFlattened, simplify, toString, typeCheck |
Methods inherited from class java.lang.Object |
---|
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)
Method 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 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
expression
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |