com.saxonica.functions.xslt3

## Class AccumulatorFunctionCallPE

- java.lang.Object
- - net.sf.saxon.expr.Expression
  - - net.sf.saxon.expr.FunctionCall
    - - com.saxonica.functions.xslt3.AccumulatorFunctionCallPE

- All Implemented Interfaces:
    Serializable, SourceLocator, LocationProvider, SaxonLocator, InstructionInfo, Locator
  Direct Known Subclasses:
    AccumulatorFunctionCallEE

      public class AccumulatorFunctionCallPE
      extends FunctionCall

  This expression class represents a call to an accumulator function in an XSLT 3.0 stylesheet in SAxon-PE
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Accumulator` | `accumulator`

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

      `argument`

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

      `EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, INHERITED_CONTEXT, INSPECTION_CONTEXT, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, NAVIGATION_CONTEXT, NODE_VALUE_CONTEXT, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, W3C_CONSUMING, W3C_FREE_RANGING, W3C_GROUP_CONSUMING, W3C_MOTIONLESS, WATCH_METHOD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccumulatorFunctionCallPE(Accumulator accumulator, boolean isPostDescentFunction)` Create the call on an accumulator function

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkArguments(ExpressionVisitor visitor)` Method supplied by each class of function to check arguments during parsing, when all the argument expressions have been read
    `protected int` | `computeCardinality()` Compute the static cardinality of this expression
    `int` | `computeDependencies()` Compute the dependencies of an expression, as the union of the dependencies of its subexpressions.
    `Expression` | `copy()` Copy an expression.
    `StructuredQName` | `getFunctionName()` Get the qualified of the function being called
    `ItemType` | `getItemType(TypeHierarchy th)` Determine the data type of the expression, if possible.
    `boolean` | `isPostDescentFunction()`
    `SequenceIterator<? extends Item>` | `iterate(XPathContext context)` Return an Iterator to iterate over the values of a sequence.
    `Expression` | `preEvaluate(ExpressionVisitor visitor)` Pre-evaluate a function at compile time.
    `Expression` | `typeCheck(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType contextItemType)` Type-check the expression.

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

      `addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getExpressionName, getNumberOfArguments, hashCode, iterateSubExpressions, optimize, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString`

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

      `addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeSpecialProperties, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getExpressionCompiler, getHostLanguage, getImplementationMethod, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getStreamability, getStreamingAdjunct, getSystemId, getSystemId, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSubExpressionInfo, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, typeError`

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

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

- - ### Field Detail

    - #### accumulator

          protected Accumulator accumulator

  - ### Constructor Detail

    - #### AccumulatorFunctionCallPE

          public AccumulatorFunctionCallPE(Accumulator accumulator,
                                   boolean isPostDescentFunction)

      Create the call on an accumulator function
      Parameters:
        `accumulator` - the accumulator whose value is required
        `isPostDescentFunction` - true if this is the post-descent function name, false for the pre-descent function

  - ### Method Detail

    - #### getFunctionName

          public StructuredQName getFunctionName()

      Description copied from class: `FunctionCall`
      Get the qualified of the function being called
      Overrides:
        `getFunctionName` in class `FunctionCall`
      Returns:
        the qualified name

    - #### isPostDescentFunction

          public boolean isPostDescentFunction()

    - #### checkArguments

          protected void checkArguments(ExpressionVisitor visitor)
                                 throws XPathException

      Description copied from class: `FunctionCall`
      Method supplied by each class of function to check arguments during parsing, when all the argument expressions have been read
      Specified by:
        `checkArguments` in class `FunctionCall`
      Parameters:
        `visitor` - the expression visitor
      Throws:
        `XPathException` - if the arguments are incorrect

    - #### typeCheck

          public Expression typeCheck(ExpressionVisitor visitor,
                             ExpressionVisitor.ContextItemType contextItemType)
                               throws XPathException

      Description copied from class: `FunctionCall`
      Type-check the expression. This also calls preEvaluate() to evaluate the function if all the arguments are constant; functions that do not require this behavior can override the preEvaluate method.
      Overrides:
        `typeCheck` in class `FunctionCall`
      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 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)

    - #### preEvaluate

          public Expression preEvaluate(ExpressionVisitor visitor)
                                 throws XPathException

      Description copied from class: `FunctionCall`
      Pre-evaluate a function at compile time. Functions that do not allow pre-evaluation, or that need access to context information, can override this method.
      Overrides:
        `preEvaluate` in class `FunctionCall`
      Parameters:
        `visitor` - an expression visitor
      Returns:
        the result of the early evaluation, or the original expression, or potentially a simplified expression
      Throws:
        `XPathException` - if evaluation fails

    - #### getItemType

          public ItemType getItemType(TypeHierarchy th)

      Description copied from class: `Expression`
      Determine the data type of the expression, if possible. All expression return sequences, in general; this method determines the type of the items within the sequence, assuming that (a) this is known in advance, and (b) it is the same for all items in the sequence.

      This method should always return a result, though it may be the best approximation that is available at the time.

      Specified by:
        `getItemType` in class `Expression`
      Parameters:
        `th` - the type hierarchy cache
      Returns:
        a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, or Type.ITEM (meaning not known at compile time)

    - #### computeDependencies

          public int computeDependencies()

      Description copied from class: `Expression`
      Compute the dependencies of an expression, as the union of the dependencies of its subexpressions. (This is overridden for path expressions and filter expressions, where the dependencies of a subexpression are not all propogated). This method should be called only once, to compute the dependencies; after that, getDependencies should be used.
      Overrides:
        `computeDependencies` in class `Expression`
      Returns:
        the depencies, as a bit-mask

    - #### computeCardinality

          protected int computeCardinality()

      Description copied from class: `Expression`
      Compute the static cardinality of this expression
      Specified by:
        `computeCardinality` in class `Expression`
      Returns:
        the computed cardinality, as one of the values `StaticProperty.ALLOWS_ZERO_OR_ONE`, `StaticProperty.EXACTLY_ONE`, `StaticProperty.ALLOWS_ONE_OR_MORE`, `StaticProperty.ALLOWS_ZERO_OR_MORE`

    - #### copy

          public Expression copy()

      Description copied from class: `Expression`
      Copy an expression. This makes a deep copy.
      Specified by:
        `copy` in class `Expression`
      Returns:
        the copy of the original expression

    - #### iterate

          public SequenceIterator<? extends Item> iterate(XPathContext context)
                                                   throws XPathException

      Description copied from class: `Expression`
      Return an Iterator to iterate over the values of a sequence. The value of every expression can be regarded as a sequence, so this method is supported for all expressions. This default implementation handles iteration for expressions that return singleton values: for non-singleton expressions, the subclass must provide its own implementation.
      Overrides:
        `iterate` in class `Expression`
      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

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