Package net.sf.saxon.expr.flwor

## Class OuterForExpression

- java.lang.Object
- - net.sf.saxon.expr.Expression
  - - net.sf.saxon.expr.Assignation
    - - net.sf.saxon.expr.ForExpression
      - - net.sf.saxon.expr.flwor.OuterForExpression

- All Implemented Interfaces:
    `Binding`, `ExportAgent`, `LocalBinding`, `Locatable`, `IdentityComparable`, `Traceable`

      public class OuterForExpression
      extends ForExpression

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.sf.saxon.expr.ForExpression

      `ForExpression.MappingAction`

  - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.expr.Assignation

      `hasLoopingReference, isIndexedVariable, references, requiredType, slotNumber, variableName`

    - ### Fields inherited from class net.sf.saxon.expr.Expression

      `EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OuterForExpression()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Expression` | `copy​(RebindingMap rebindings)` | 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)` |
    `java.lang.String` | `getExpressionName()` | Get a name identifying the kind of expression, in terms meaningful to a user.
    `protected int` | `getRangeVariableCardinality()` | Get the cardinality of the range variable
    `SequenceIterator` | `iterate​(XPathContext context)` | Iterate over the result of the expression
    `Expression` | `optimize​(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType)` | Optimize the expression
    `void` | `process​(Outputter output, 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, export, getImplementationMethod, getIntegerBounds, getItemType, getStaticUType, getStreamerName, isVacuousExpression, markTailFunctionCalls, toShortString, toString, typeCheck, unordered`

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

      `addReference, addToPathMap, checkForUpdatingSubexpressions, computeDependencies, evaluateVariable, getAction, getActionOp, getCost, getIntegerBoundsForVariable, getLocalSlotNumber, getNominalReferenceCount, getObjectName, getRequiredSlots, getRequiredType, getSequence, getSequenceOp, getVariableEQName, getVariableName, getVariableQName, hasVariableBinding, isAssignable, isGlobal, isIndexedVariable, isUpdatingExpression, operands, rebuildReferenceList, refineTypeInformation, removeDeadReferences, replaceVariable, setAction, setIndexedVariable, setRequiredType, setSequence, setSlotNumber, setVariableQName, suppressValidation, verifyReferences`

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

      `adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, computeHashCode, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, equals, evaluateAsString, evaluateItem, explain, getCardinality, getConfiguration, getDependencies, getEvaluationMethod, getExtraProperty, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, operandList, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, toPattern, typeCheckChildren, typeError, verifyParentPointers`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface net.sf.saxon.trace.Traceable

      `gatherProperties`

- - ### 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,
                                     ContextItemStaticInfo 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​(RebindingMap rebindings)

      Copy an expression. This makes a deep copy.
      Overrides:
        `copy` in class `ForExpression`
      Parameters:
        `rebindings` -
      Returns:
        the copy of the original expression

    - #### iterate

          public SequenceIterator iterate​(XPathContext context)
                                   throws XPathException

      Iterate over the result of the expression
      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

    - #### process

          public void process​(Outputter output,
                              XPathContext context)
                       throws XPathException

      Process this expression as an instruction, writing results to the current outputter
      Overrides:
        `process` in class `ForExpression`
      Parameters:
        `output` - the destination for the result
        `context` - The dynamic context, giving access to the current node, the current variables, etc.
      Throws:
        `XPathException` - if a dynamic error occurs

    - #### getExpressionName

          public java.lang.String getExpressionName()

      Get a name identifying the kind of expression, in terms meaningful to a user.
      Overrides:
        `getExpressionName` in class `ForExpression`
      Returns:
        a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the expression.

    - #### 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` - if evaluation fails

    - #### explainSpecializedAttributes

          protected void explainSpecializedAttributes​(ExpressionPresenter out)

      Overrides:
        `explainSpecializedAttributes` in class `ForExpression`