com.saxonica.expr.ee

## Class MultithreadedApplyTemplates.ApplyTemplatesPackage

- java.lang.Object
- - com.saxonica.expr.ee.MultithreadedApplyTemplates.ApplyTemplatesPackage

- All Implemented Interfaces:
    TailCall
  Enclosing class:
    MultithreadedApplyTemplates

      protected class MultithreadedApplyTemplates.ApplyTemplatesPackage
      extends Object
      implements TailCall

  An ApplyTemplatesPackage is an object that encapsulates the sequence of nodes to be processed, the mode, the parameters to be supplied, and the execution context. This object can be returned as a tail call, so that the actual call is made from a lower point on the stack, allowing a tail-recursive template to execute in a finite stack size

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultithreadedApplyTemplates.ApplyTemplatesPackage(Sequence selectedItems, Mode mode, ParameterSet params, ParameterSet tunnelParams, XPathContextMajor context, int locationId)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TailCall` | `applyTemplates()`
    `TailCall` | `processLeavingTail()` Process this TailCall (that is, executed the template call that is packaged in this object).

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

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

- - ### Constructor Detail

    - #### MultithreadedApplyTemplates.ApplyTemplatesPackage

          public MultithreadedApplyTemplates.ApplyTemplatesPackage(Sequence selectedItems,
                                                           Mode mode,
                                                           ParameterSet params,
                                                           ParameterSet tunnelParams,
                                                           XPathContextMajor context,
                                                           int locationId)
                                                            throws XPathException

      Throws:
        `XPathException`

  - ### Method Detail

    - #### applyTemplates

          public TailCall applyTemplates()
                                  throws XPathException

      Throws:
        `XPathException`

    - #### processLeavingTail

          public TailCall processLeavingTail()
                                      throws XPathException

      Description copied from interface: `TailCall`
      Process this TailCall (that is, executed the template call that is packaged in this object). This may return a further TailCall, which should also be processed: this is the mechanism by which a nested set of recursive calls is converted into an iteration.
      Specified by:
        `processLeavingTail` in interface `TailCall`
      Returns:
        a further TailCall, if the recursion continues, or null, indicating that the recursion has terminated.
      Throws:
        `XPathException` - if any error occurs processing the tail call

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