Interface MappingFunction

  • All Known Implementing Classes:
    ForExpression.MappingAction, SequenceMapper
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface MappingFunction
    MappingFunction is an interface that must be satisfied by an object passed to a MappingIterator. It represents an object which, given an Item, can return a SequenceIterator that delivers a sequence of zero or more Items.

    It maps an item of class F to a sequence of items of class T, returned as an iterator.

    NOTE: Java allows a lambda expression to be used where an ItemMappingFunction is needed, but C# does not (it's not possible in C# to have a class implementing a delegate). So if a delegate is wanted, use SequenceMapper.

    • Method Detail

      • map

        SequenceIterator map​(Item item)
                      throws XPathException
        Map one item to a sequence.
        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