net.sf.saxon.om

## Interface FunctionItem

- All Superinterfaces:
    Callable, GroundedValue, Item, PullEvent, Sequence
  All Known Subinterfaces:
    MapItem
  All Known Implementing Classes:
    AbstractFunctionItem, AtomicConstructorFunctionItem, CallableFunctionItem, CoercedFunction, CurriedFunction, ImmutableMap, RangeKey, SingletonMap, UserFunctionItem

      public interface FunctionItem
      extends Item, Callable, GroundedValue

  XDM 3.0 introduces a third kind of item, beyond nodes and atomic values: the function item. Function items implement this marker interface. The actual implementation class is in Saxon-PE and Saxon-EE only.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Sequence` | `call(XPathContext context, Sequence[] args)` Invoke the function
    `boolean` | `deepEquals(FunctionItem other, XPathContext context, AtomicComparer comparer, int flags)` Test whether this FunctionItem is deep-equal to another function item, under the rules of the deep-equal function
    `int` | `getArity()` Get the arity of the function
    `FunctionItemType` | `getFunctionItemType(TypeHierarchy th)` Get the item type of the function item
    `StructuredQName` | `getFunctionName()` Get the name of the function, or null if it is anonymous

    - ### Methods inherited from interface net.sf.saxon.om.Item

      `getStringValue, getStringValueCS`

    - ### Methods inherited from interface net.sf.saxon.om.GroundedValue

      `effectiveBooleanValue, getLength, getStringValue, getStringValueCS, itemAt, reduce, subsequence`

    - ### Methods inherited from interface net.sf.saxon.om.Sequence

      `head, iterate`

- - ### Method Detail

    - #### getFunctionItemType

          FunctionItemType getFunctionItemType(TypeHierarchy th)

      Get the item type of the function item
      Parameters:
        `th` - the type hierarchy cache
      Returns:
        the function item's type

    - #### getFunctionName

          StructuredQName getFunctionName()

      Get the name of the function, or null if it is anonymous
      Returns:
        the function name, or null for an anonymous inline function

    - #### getArity

          int getArity()

      Get the arity of the function
      Returns:
        the number of arguments in the function signature

    - #### call

          Sequence call(XPathContext context,
                      Sequence[] args)
                        throws XPathException

      Invoke the function
      Specified by:
        `call` in interface `Callable`
      Parameters:
        `context` - the XPath dynamic evaluation context
        `args` - the actual arguments to be supplied
      Returns:
        the result of invoking the function
      Throws:
        `XPathException` - if a dynamic error occurs within the function

    - #### deepEquals

          boolean deepEquals(FunctionItem other,
                           XPathContext context,
                           AtomicComparer comparer,
                           int flags)
                             throws XPathException

      Test whether this FunctionItem is deep-equal to another function item, under the rules of the deep-equal function
      Parameters:
        `other` - the other function item
        `context` - the dynamic evaluation context
        `comparer` - the object to perform the comparison
        `flags` - options for how the comparison is performed
      Returns:
        true if the two function items are deep-equal
      Throws:
        `XPathException` - if the comparison cannot be performed

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