## com.saxonica.expr
Class OuterForExpression

    java.lang.Object
      net.sf.saxon.expr.Expression
          net.sf.saxon.expr.Assignation
              net.sf.saxon.expr.ForExpression
                  com.saxonica.expr.OuterForExpression

All Implemented Interfaces:
  Serializable, SourceLocator, LocationProvider, SaxonLocator, Binding, EvaluableItem, SequenceIterable, InstructionInfo, Locator

    public class OuterForExpression

extends ForExpression

Expression class that implements the "outer for" clause of XQuery 1.1

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class net.sf.saxon.expr.ForExpression
`ForExpression.EventMappingAction, ForExpression.MappingAction`

Field Summary

Fields inherited from class net.sf.saxon.expr.ForExpression
`positionVariable`

Fields inherited from class net.sf.saxon.expr.Assignation
`action, requiredType, sequence, slotNumber, variableName`

Fields inherited from class net.sf.saxon.expr.Expression
`EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD`

Constructor Summary
`OuterForExpression()`

Method Summary
`Expression` `copy()` Copy an expression.
`void` `evaluatePendingUpdates(XPathContext context, PendingUpdateList pul)` Evaluate an updating expression, adding the results to a Pending Update List.
`protected void` `explainSpecializedAttributes(ExpressionPresenter out)`
`protected int` `getRangeVariableCardinality()` Get the cardinality of the range variable
`SequenceIterator` `iterate(XPathContext context)` Iterate over the result of the expression
`EventIterator` `iterateEvents(XPathContext context)` Deliver the result of the expression as a sequence of events.
`Expression` `optimize(ExpressionVisitor visitor, ItemType contextItemType)` Optimize the expression
`void` `process(XPathContext context)` Process this expression as an instruction, writing results to the current outputter

Methods inherited from class net.sf.saxon.expr.ForExpression
`checkPermittedContents, computeCardinality, explain, extendBindingList, getConstructType, getExpressionName, getImplementationMethod, getItemType, getPositionVariableName, getRequiredSlots, hasLoopingSubexpression, isVacuousExpression, markTailFunctionCalls, setPositionVariable, setSlotNumber, toString, typeCheck`

Methods inherited from class net.sf.saxon.expr.Assignation

`addReference, addToPathMap, checkForUpdatingSubexpressions, evaluateVariable, getAction, getLocalSlotNumber, getNominalReferenceCount, getObjectName, getRequiredType, getSequence, getVariableName, getVariableQName, isAssignable, isGlobal, isIndexedVariable, isUpdatingExpression, iterateSubExpressions, promote, promoteWhereClause, refineTypeInformation, replaceSubExpression, replaceVariable, setAction, setIndexedVariable, setRequiredType, setSequence, setVariableQName, simplify, suppressValidation`

Methods inherited from class net.sf.saxon.expr.Expression

`adoptChildExpression, computeDependencies, computeSpecialProperties, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, getCardinality, getColumnNumber, getColumnNumber, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, implementsStaticTypeCheck, isSubtreeExpression, iterateSameFocusSubExpressions, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, typeError`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### OuterForExpression

    public OuterForExpression()

Method Detail

### getRangeVariableCardinality

    protected int getRangeVariableCardinality()

  Get the cardinality of the range variable

  Overrides:
    `getRangeVariableCardinality` in class `ForExpression`
  Returns:
    the cardinality of the range variable (StaticProperty.EXACTLY_ONE). in a subclass

### optimize

    public Expression optimize(ExpressionVisitor visitor,
                               ItemType contextItemType)
                        throws XPathException

  Optimize the expression

  Overrides:
    `optimize` in class `ForExpression`
  Parameters:
    `visitor` - an expression visitor
    `contextItemType` - the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to `Type.ITEM_TYPE`
  Returns:
    the original expression, rewritten if appropriate to optimize execution
  Throws:
    `XPathException` - if an error is discovered during this phase (typically a type error)

### copy

    public Expression copy()

  Copy an expression. This makes a deep copy.

  Overrides:
    `copy` in class `ForExpression`
  Returns:
    the copy of the original expression

### iterate

    public SequenceIterator iterate(XPathContext context)
                             throws XPathException

  Iterate over the result of the expression

  Specified by:
    `iterate` in interface `SequenceIterable`
  Overrides:
    `iterate` in class `ForExpression`
  Parameters:
    `context` - supplies the context for evaluation
  Returns:
    a SequenceIterator that can be used to iterate over the result of the expression
  Throws:
    `XPathException` - if any dynamic error occurs evaluating the expression

### iterateEvents

    public EventIterator iterateEvents(XPathContext context)
                                throws XPathException

  Deliver the result of the expression as a sequence of events.

  Overrides:
    `iterateEvents` in class `ForExpression`
  Parameters:
    `context` - The dynamic evaluation context
  Returns:
    the result of the expression as an iterator over a sequence of PullEvent objects
  Throws:
    `XPathException` - if a dynamic error occurs during expression evaluation

### process

    public void process(XPathContext context)
                 throws XPathException

  Process this expression as an instruction, writing results to the current outputter

  Overrides:
    `process` in class `ForExpression`
  Parameters:
    `context` - The dynamic context, giving access to the current node, the current variables, etc.
  Throws:
    `XPathException`

### evaluatePendingUpdates

    public void evaluatePendingUpdates(XPathContext context,
                                       PendingUpdateList pul)
                                throws XPathException

  Evaluate an updating expression, adding the results to a Pending Update List. The default implementation of this method, which is used for non-updating expressions, throws an UnsupportedOperationException

  Overrides:
    `evaluatePendingUpdates` in class `ForExpression`
  Parameters:
    `context` - the XPath dynamic evaluation context
    `pul` - the pending update list to which the results should be written
  Throws:
    `XPathException`

### explainSpecializedAttributes

    protected void explainSpecializedAttributes(ExpressionPresenter out)

  Overrides:
    `explainSpecializedAttributes` in class `ForExpression`

Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.