Package net.sf.saxon.expr.accum

## Class Accumulator

- java.lang.Object
- - net.sf.saxon.expr.instruct.Actor
  - - net.sf.saxon.expr.accum.Accumulator

- All Implemented Interfaces:
    `javax.xml.transform.SourceLocator`, `ExpressionOwner`, `Location`, `org.xml.sax.Locator`

      public class Accumulator
      extends Actor

  Represents a single accumulator declared in an XSLT 3.0 stylesheet

- - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.expr.instruct.Actor

      `body`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addChildExpression​(Expression expression)` | Add an expression to the list of expressions used by this accumulator
    `void` | `export​(ExpressionPresenter presenter)` | Export expression structure.
    `void` | `export​(ExpressionPresenter out, java.util.Map<Component,​java.lang.Integer> componentIdMap)` | Export expression structure.
    `StructuredQName` | `getAccumulatorName()` | Get the name of the accumulator
    `int` | `getImportPrecedence()` | Get the import precedence
    `Expression` | `getInitialValueExpression()` | Get the expression that computes the initial value of the accumulator
    `StructuredQName` | `getObjectName()` | Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.
    `SimpleMode` | `getPostDescentRules()` | Get the set of rules for phase="end", held in the form of a Mode object
    `SimpleMode` | `getPreDescentRules()` | Get the set of rules for phase="start", held in the form of a Mode object
    `SlotManager` | `getSlotManagerForInitialValueExpression()` | Get the slotManager to be used for evaluating the initial-value expression
    `SymbolicName` | `getSymbolicName()` | Get the symbolic name of the component
    `SequenceType` | `getType()` | Get the declared type of the accumulator.
    `boolean` | `isCompatible​(Accumulator other)` | Determine whether this accumulator is compatible with one that it overrides
    `boolean` | `isDeclaredStreamable()` | Ask whether the accumulator is declared streamable
    `boolean` | `isTracing()` | Ask whether diagnostic tracing is enabled for this accumulator
    `boolean` | `isUniversallyApplicable()` | Ask whether this accumulator is universally appicable to all documents
    `void` | `setAccumulatorName​(StructuredQName firstName)` | Set the name of the pre-descent function
    `void` | `setDeclaredStreamable​(boolean streamable)` | Say whether the accumulator is declared streamable
    `void` | `setImportPrecedence​(int importPrecedence)` | Set the import precedence
    `void` | `setInitialValueExpression​(Expression initialValueExpression)` | Set the expression that computes the initial value of the accumulator
    `void` | `setPostDescentRules​(SimpleMode postDescentRules)` | Set the set of rules for phase="end", held in the form of a Mode object
    `void` | `setPreDescentRules​(SimpleMode preDescentRules)` | Set the set of rules for phase="start", held in the form of a Mode object
    `void` | `setSlotManagerForInitialValueExpression​(SlotManager slotManagerForInitialValueExpression)` | Set the slotManager to be used for evaluating the initial-value expression
    `void` | `setTracing​(boolean tracing)` | Say whether diagnostic tracing is to be enabled for this accumulator
    `void` | `setType​(SequenceType type)` | Set the declared type of the accumulator.
    `void` | `setUniversallyApplicable​(boolean universal)` | Say whether this accumulator is universally appicable to all documents

    - ### Methods inherited from class net.sf.saxon.expr.instruct.Actor

      `allocateAllBindingSlots, allocateBindingSlotsRecursive, getBody, getChildExpression, getColumnNumber, getComponentName, getDeclaredVisibility, getDeclaringComponent, getLineNumber, getLocation, getPackageData, getProperties, getProperty, getPublicId, getRetainedStaticContext, getStackFrameMap, getSystemId, getTracingTag, isExportable, makeDeclaringComponent, obtainDeclaringComponent, saveLocation, setBody, setChildExpression, setColumnNumber, setDeclaredVisibility, setDeclaringComponent, setLineNumber, setPackageData, setRetainedStaticContext, setStackFrameMap, setSystemId`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Accumulator

          public Accumulator()

  - ### Method Detail

    - #### getSymbolicName

          public SymbolicName getSymbolicName()

      Get the symbolic name of the component
      Specified by:
        `getSymbolicName` in class `Actor`
      Returns:
        the symbolic name

    - #### isDeclaredStreamable

          public boolean isDeclaredStreamable()

      Ask whether the accumulator is declared streamable
      Returns:
        true if it is declared with streamable="yes"

    - #### setDeclaredStreamable

          public void setDeclaredStreamable​(boolean streamable)

      Say whether the accumulator is declared streamable
      Parameters:
        `streamable` - true if it is declared with streamable="yes"

    - #### getAccumulatorName

          public StructuredQName getAccumulatorName()

      Get the name of the accumulator
      Returns:
        the accumulator name

    - #### setAccumulatorName

          public void setAccumulatorName​(StructuredQName firstName)

      Set the name of the pre-descent function
      Parameters:
        `firstName` - the function name (always present)

    - #### getImportPrecedence

          public int getImportPrecedence()

      Get the import precedence
      Returns:
        the import precedence of the accumulator

    - #### setImportPrecedence

          public void setImportPrecedence​(int importPrecedence)

      Set the import precedence
      Parameters:
        `importPrecedence` - the import precedence of the accumulator

    - #### setUniversallyApplicable

          public void setUniversallyApplicable​(boolean universal)

      Say whether this accumulator is universally appicable to all documents
      Parameters:
        `universal` - true if this accumulator is universally applicable

    - #### isUniversallyApplicable

          public boolean isUniversallyApplicable()

      Ask whether this accumulator is universally appicable to all documents
      Returns:
        true if this accumulator is universally applicable

    - #### isTracing

          public boolean isTracing()

      Ask whether diagnostic tracing is enabled for this accumulator
      Returns:
        true if diagnostic tracing is enabled

    - #### setTracing

          public void setTracing​(boolean tracing)

      Say whether diagnostic tracing is to be enabled for this accumulator
      Parameters:
        `tracing` - true if diagnostic tracing is to be enabled

    - #### getSlotManagerForInitialValueExpression

          public SlotManager getSlotManagerForInitialValueExpression()

      Get the slotManager to be used for evaluating the initial-value expression
      Returns:
        the slotManager for the initial-value expression (defining any local variables declared and used within this expression)

    - #### setSlotManagerForInitialValueExpression

          public void setSlotManagerForInitialValueExpression​(SlotManager slotManagerForInitialValueExpression)

      Set the slotManager to be used for evaluating the initial-value expression
      Parameters:
        `slotManagerForInitialValueExpression` - the slotManager for the initial-value expression (defining any local variables declared and used within this expression)

    - #### getPreDescentRules

          public SimpleMode getPreDescentRules()

      Get the set of rules for phase="start", held in the form of a Mode object
      Returns:
        the Mode object containing all the rules that apply to phase="start"

    - #### setPreDescentRules

          public void setPreDescentRules​(SimpleMode preDescentRules)

      Set the set of rules for phase="start", held in the form of a Mode object
      Parameters:
        `preDescentRules` - the Mode object containing all the rules that apply to phase="start"

    - #### getPostDescentRules

          public SimpleMode getPostDescentRules()

      Get the set of rules for phase="end", held in the form of a Mode object
      Returns:
        the Mode object containing all the rules that apply to phase="end"

    - #### setPostDescentRules

          public void setPostDescentRules​(SimpleMode postDescentRules)

      Set the set of rules for phase="end", held in the form of a Mode object
      Parameters:
        `postDescentRules` - the Mode object containing all the rules that apply to phase="end"

    - #### getInitialValueExpression

          public Expression getInitialValueExpression()

      Get the expression that computes the initial value of the accumulator
      Returns:
        the initial value expression

    - #### setInitialValueExpression

          public void setInitialValueExpression​(Expression initialValueExpression)

      Set the expression that computes the initial value of the accumulator
      Parameters:
        `initialValueExpression` - the initial value expression

    - #### addChildExpression

          public void addChildExpression​(Expression expression)

      Add an expression to the list of expressions used by this accumulator
      Parameters:
        `expression` - the expression to be added to the list

    - #### getType

          public SequenceType getType()

      Get the declared type of the accumulator. The initial value and all intermediate values must conform to this type
      Returns:
        the declared type of the accumulator

    - #### setType

          public void setType​(SequenceType type)

      Set the declared type of the accumulator. The initial value and all intermediate values must conform to this type
      Parameters:
        `type` - the declared type of the accumulator

    - #### isCompatible

          public boolean isCompatible​(Accumulator other)

      Determine whether this accumulator is compatible with one that it overrides
      Parameters:
        `other` - the accumlator that this one overrides
      Returns:
        true if they are compatible, as defined in the XSLT 3.0 specification

    - #### getObjectName

          public StructuredQName getObjectName()

      Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically.
      Returns:
        the QName of the object declared or manipulated by this instruction or expression

    - #### export

          public void export​(ExpressionPresenter presenter)
                      throws XPathException

      Export expression structure. The abstract expression tree is written to the supplied outputstream.
      Specified by:
        `export` in class `Actor`
      Parameters:
        `presenter` - the expression presenter used to generate the XML representation of the structure
      Throws:
        `XPathException`

    - #### export

          public void export​(ExpressionPresenter out,
                             java.util.Map<Component,​java.lang.Integer> componentIdMap)
                      throws XPathException

      Export expression structure. The abstract expression tree is written to the supplied outputstream.
      Parameters:
        `out` - the expression presenter used to display the structure
      Throws:
        `XPathException`