Package net.sf.saxon.expr.parser
Class Evaluator
- java.lang.Object
- 
- net.sf.saxon.expr.parser.Evaluator
 
- 
 public abstract class Evaluator extends java.lang.ObjectAn Evaluator evaluates an expression to return a sequence
- 
- 
Field SummaryFields Modifier and Type Field Description static EvaluatorEAGER_SEQUENCEAn evaluator for arguments that in general return a sequence, where the sequence is evaluated eagerly.static EvaluatorEMPTY_SEQUENCEAn evaluator that always returns the empty sequencestatic EvaluatorLAZY_SEQUENCEAn evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use.static EvaluatorLAZY_TAILAn evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use.static EvaluatorLITERALAn evaluator for arguments supplied as a literalstatic EvaluatorMAKE_INDEXED_VARIABLEAn evaluator for an expression that makes use of an indexed variablestatic EvaluatorMEMO_CLOSUREAn evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.static EvaluatorMEMO_SEQUENCEAn evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.static EvaluatorOPTIONAL_ITEMA (default) evaluator for arguments supplied as an expression that will return either a singleton item, or an empty sequencestatic EvaluatorPROCESSA push-mode evaluator for an expressionstatic EvaluatorSHARED_APPENDAn evaluator for "shared append" expressions: used when the argument to a function is a block potentially containing a recursive call.static EvaluatorSINGLE_ITEMA (default) evaluator for arguments supplied as an expression that will always return a singleton itemstatic EvaluatorSINGLETON_CLOSUREAn evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.static EvaluatorSTREAMING_ARGUMENTAn evaluator for the first (streamed) argument of a streamable function call.static EvaluatorSUPPLIED_PARAMETERAn evaluator for a reference to an external parameter valuestatic EvaluatorVARIABLEAn evaluator for arguments supplied as a variable reference
 - 
Constructor SummaryConstructors Constructor Description Evaluator()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Sequenceevaluate(Expression expr, XPathContext context)Evaluate an expression to return a sequenceabstract EvaluationModegetEvaluationMode()Get an integer code identifying this evaluator (for use in the SEF file).
 
- 
- 
- 
Field Detail- 
EMPTY_SEQUENCEpublic static final Evaluator EMPTY_SEQUENCE An evaluator that always returns the empty sequence
 - 
LITERALpublic static final Evaluator LITERAL An evaluator for arguments supplied as a literal
 - 
VARIABLEpublic static final Evaluator VARIABLE An evaluator for arguments supplied as a variable reference
 - 
SUPPLIED_PARAMETERpublic static final Evaluator SUPPLIED_PARAMETER An evaluator for a reference to an external parameter value
 - 
SINGLE_ITEMpublic static final Evaluator SINGLE_ITEM A (default) evaluator for arguments supplied as an expression that will always return a singleton item
 - 
OPTIONAL_ITEMpublic static final Evaluator OPTIONAL_ITEM A (default) evaluator for arguments supplied as an expression that will return either a singleton item, or an empty sequence
 - 
LAZY_SEQUENCEpublic static final Evaluator LAZY_SEQUENCE An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use. This is appropriate when calling a function which might not use the value, or might not use all of it. It returns aLazySequence, which can only be read once, so this is only suitable for use when calling a function that can be trusted to read the argument once only.
 - 
MEMO_SEQUENCEpublic static final Evaluator MEMO_SEQUENCE An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
 - 
MEMO_CLOSUREpublic static final Evaluator MEMO_CLOSURE An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
 - 
SINGLETON_CLOSUREpublic static final Evaluator SINGLETON_CLOSURE An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use, and where the value might be needed more than once.
 - 
EAGER_SEQUENCEpublic static final Evaluator EAGER_SEQUENCE An evaluator for arguments that in general return a sequence, where the sequence is evaluated eagerly. This is appropriate when it is known that the function will always use the entire value, or when it will use it more than once.
 - 
SHARED_APPENDpublic static final Evaluator SHARED_APPEND An evaluator for "shared append" expressions: used when the argument to a function is a block potentially containing a recursive call.
 - 
STREAMING_ARGUMENTpublic static final Evaluator STREAMING_ARGUMENT An evaluator for the first (streamed) argument of a streamable function call.
 - 
MAKE_INDEXED_VARIABLEpublic static final Evaluator MAKE_INDEXED_VARIABLE An evaluator for an expression that makes use of an indexed variable
 - 
PROCESSpublic static final Evaluator PROCESS A push-mode evaluator for an expression
 - 
LAZY_TAILpublic static final Evaluator LAZY_TAIL An evaluator for arguments that in general return a sequence, where the sequence is evaluated lazily on first use. This is appropriate when calling a function which might not use the value, or might not use all of it. It returns aLazySequence, which can only be read once, so this is only suitable for use when calling a function that can be trusted to read the argument once only.
 
- 
 - 
Method Detail- 
evaluatepublic abstract Sequence evaluate(Expression expr, XPathContext context) throws XPathException Evaluate an expression to return a sequence- Parameters:
- expr- the expression to be evaluated
- context- the dynamic context for evaluation
- Returns:
- the result of the evaluation
- Throws:
- XPathException- if any dynamic error occurs during the evaluation
 
 - 
getEvaluationModepublic abstract EvaluationMode getEvaluationMode() Get an integer code identifying this evaluator (for use in the SEF file). The codes are chosen to be compatible with argument evaluation modes in earlier releases in the interests of SEF compatibility.
 
- 
 
-