net.sf.saxon.expr
Class QuantifiedExpression

java.lang.Object
  extended by net.sf.saxon.expr.ComputedExpression
      extended by net.sf.saxon.expr.Assignation
          extended by net.sf.saxon.expr.QuantifiedExpression
All Implemented Interfaces:
Serializable, Binding, Expression

 class QuantifiedExpression
extends Assignation

A QuantifiedExpression tests whether some/all items in a sequence satisfy some condition.


Field Summary
 
Fields inherited from class net.sf.saxon.expr.Assignation
action, declaration, sequence, slotNumber, variableName
 
Fields inherited from class net.sf.saxon.expr.ComputedExpression
lineNumber, NO_ARGUMENTS, staticProperties
 
Constructor Summary
QuantifiedExpression()
           
 
Method Summary
 Expression analyze(StaticContext env)
          Type-check the expression
 int computeCardinality()
          Determine the static cardinality
 void display(int level, NamePool pool)
          Diagnostic print of expression structure
 boolean effectiveBooleanValue(XPathContext context)
          Get the result as a boolean
 Item evaluateItem(XPathContext context)
          Evaluate the expression to return a singleton value
 ItemType getItemType()
          Determine the data type of the items returned by the expression
 SequenceType getRequiredType()
          Get data type of the range variable (part of the Binding interface)
 void setOperator(int operator)
           
 
Methods inherited from class net.sf.saxon.expr.Assignation
evaluateVariable, getSubExpressions, getVariableName, promote, setAction, setSequence, setSlotNumber, setVariableDeclaration, simplify
 
Methods inherited from class net.sf.saxon.expr.ComputedExpression
computeDependencies, computeSpecialProperties, computeStaticProperties, dynamicError, evaluateAsString, getCardinality, getDependencies, getIntrinsicDependencies, getLineNumber, getSpecialProperties, iterate, markTailFunctionCalls, setLineNumber, typeError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuantifiedExpression

QuantifiedExpression()
Method Detail

setOperator

public void setOperator(int operator)

computeCardinality

public int computeCardinality()
Determine the static cardinality

Specified by:
computeCardinality in class ComputedExpression

analyze

public Expression analyze(StaticContext env)
                   throws XPathException
Type-check the expression

Parameters:
env - the static context of the expression
Returns:
the original expression, rewritten to perform necessary run-time type checks, and to perform other type-related optimizations
Throws:
XPathException - if an error is discovered during this phase (typically a type error)

evaluateItem

public Item evaluateItem(XPathContext context)
                  throws XPathException
Evaluate the expression to return a singleton value

Specified by:
evaluateItem in interface Expression
Overrides:
evaluateItem in class ComputedExpression
Parameters:
context - The context in which the expression is to be evaluated
Returns:
the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
Throws:
XPathException - if any dynamic error occurs evaluating the expression

effectiveBooleanValue

public boolean effectiveBooleanValue(XPathContext context)
                              throws XPathException
Get the result as a boolean

Specified by:
effectiveBooleanValue in interface Expression
Overrides:
effectiveBooleanValue in class ComputedExpression
Parameters:
context - The context in which the expression is to be evaluated
Returns:
the effective boolean value
Throws:
XPathException - if any dynamic error occurs evaluating the expression

getItemType

public ItemType getItemType()
Determine the data type of the items returned by the expression

Returns:
Type.BOOLEAN

getRequiredType

public SequenceType getRequiredType()
Get data type of the range variable (part of the Binding interface)

Specified by:
getRequiredType in interface Binding
Overrides:
getRequiredType in class Assignation

display

public void display(int level,
                    NamePool pool)
Diagnostic print of expression structure

Parameters:
level - indentation level for this expression