net.sf.saxon.expr

## Class ForExpression.MappingAction

- java.lang.Object
- - net.sf.saxon.expr.ForExpression.MappingAction

- All Implemented Interfaces:
    ItemMappingFunction, MappingFunction, StatefulMappingFunction
  Enclosing class:
    ForExpression

      public static class ForExpression.MappingAction
      extends Object
      implements MappingFunction, ItemMappingFunction, StatefulMappingFunction

  The MappingAction represents the action to be taken for each item in the source sequence. It acts as the MappingFunction for the mapping iterator.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected XPathContext` | `context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ForExpression.MappingAction()`
    `ForExpression.MappingAction(XPathContext context, int slotNumber, int pslot, Expression action)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `StatefulMappingFunction` | `getAnother()` Return a clone of this MappingFunction, with the state reset to its state at the beginning of the underlying iteration
    `SequenceIterator` | `map(Item item)` Map one item to a sequence.
    `Item` | `mapItem(Item item)` Map one item to another item.

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

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

- - ### Field Detail

    - #### context

          protected XPathContext context

  - ### Constructor Detail

    - #### ForExpression.MappingAction

          public ForExpression.MappingAction()

    - #### ForExpression.MappingAction

          public ForExpression.MappingAction(XPathContext context,
                                     int slotNumber,
                                     int pslot,
                                     Expression action)

  - ### Method Detail

    - #### map

          public SequenceIterator map(Item item)
                               throws XPathException

      Description copied from interface: `MappingFunction`
      Map one item to a sequence.
      Specified by:
        `map` in interface `MappingFunction`
      Parameters:
        `item` - The item to be mapped.
      Returns:
        one of the following: (a) a SequenceIterator over the sequence of items that the supplied input item maps to, or (b) null if it maps to an empty sequence.
      Throws:
        `XPathException` - if a dynamic error occurs

    - #### mapItem

          public Item mapItem(Item item)
                       throws XPathException

      Description copied from interface: `ItemMappingFunction`
      Map one item to another item.
      Specified by:
        `mapItem` in interface `ItemMappingFunction`
      Parameters:
        `item` - The input item to be mapped.
      Returns:
        either the output item, or null.
      Throws:
        `XPathException` - if a dynamic error occurs

    - #### getAnother

          public StatefulMappingFunction getAnother()

      Description copied from interface: `StatefulMappingFunction`
      Return a clone of this MappingFunction, with the state reset to its state at the beginning of the underlying iteration
      Specified by:
        `getAnother` in interface `StatefulMappingFunction`
      Returns:
        a clone of this MappingFunction

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