com.saxonica.functions.hof

## Class AbstractFunctionItem

- java.lang.Object
- - net.sf.saxon.om.AbstractItem
  - - com.saxonica.functions.hof.AbstractFunctionItem

- All Implemented Interfaces:
    PullEvent, Callable, FunctionItem, GroundedValue, Item, Sequence
  Direct Known Subclasses:
    AtomicConstructorFunctionItem, CallableFunctionItem, CoercedFunction, CurriedFunction, UserFunctionItem

      public abstract class AbstractFunctionItem
      extends AbstractItem
      implements FunctionItem

  Abstract superclass (and factory class) for implementations of FunctionItem

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractFunctionItem()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
    `boolean` | `effectiveBooleanValue()` Get the effective boolean value of this sequence
    `void` | `explain(ExpressionPresenter out)`
    `String` | `getStringValue()` Get the string value of the function item
    `CharSequence` | `getStringValueCS()` Get the string value of the function item
    `SequenceIterator` | `getTypedValue()` Get the typed value of the item.
    `void` | `optimize(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType contextItemType)` Optimize the function (may modify it)
    `void` | `simplify(ExpressionVisitor visitor)`
    `void` | `typeCheck(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType contextItemType)` Type check the function (may modify it by adding code for converting the arguments)

    - ### Methods inherited from class net.sf.saxon.om.AbstractItem

      `getLength, head, itemAt, iterate, reduce, subsequence`

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

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

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

      `call, getArity, getFunctionItemType, getFunctionName`

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

      `getLength, itemAt, reduce, subsequence`

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

      `head, iterate`

- - ### Constructor Detail

    - #### AbstractFunctionItem

          public AbstractFunctionItem()

  - ### Method Detail

    - #### getStringValue

          public String getStringValue()

      Get the string value of the function item
      Specified by:
        `getStringValue` in interface `GroundedValue`
      Specified by:
        `getStringValue` in interface `Item`
      Returns:
        the string value of the item
      Throws:
        `UnsupportedOperationException` - (the string value of a function item is not defined)
      See Also:
        `Item.getStringValueCS()`

    - #### getStringValueCS

          public CharSequence getStringValueCS()

      Get the string value of the function item
      Specified by:
        `getStringValueCS` in interface `GroundedValue`
      Specified by:
        `getStringValueCS` in interface `Item`
      Returns:
        the string value of the item
      Throws:
        `UnsupportedOperationException` - (the string value of a function item is not defined)
      See Also:
        `Item.getStringValue()`

    - #### effectiveBooleanValue

          public boolean effectiveBooleanValue()
                                        throws XPathException

      Description copied from interface: `GroundedValue`
      Get the effective boolean value of this sequence
      Specified by:
        `effectiveBooleanValue` in interface `GroundedValue`
      Returns:
        the effective boolean value
      Throws:
        `XPathException` - if the sequence has no effective boolean value (for example a sequence of two integers)

    - #### getTypedValue

          public SequenceIterator getTypedValue()
                                         throws XPathException

      Get the typed value of the item.
      Returns:
        an iterator over the items in the typed value of the node or atomic value. The items returned by this iterator will always be atomic values.
      Throws:
        `XPathException` - (always) - a function item cannot be atomized

    - #### simplify

          public void simplify(ExpressionVisitor visitor)
                        throws XPathException

      Throws:
        `XPathException`

    - #### typeCheck

          public void typeCheck(ExpressionVisitor visitor,
                       ExpressionVisitor.ContextItemType contextItemType)
                         throws XPathException

      Type check the function (may modify it by adding code for converting the arguments)
      Parameters:
        `visitor` - the expression visitor, supplies context information
        `contextItemType` - the context item type at the point where the function definition appears
      Throws:
        `XPathException`

    - #### optimize

          public void optimize(ExpressionVisitor visitor,
                      ExpressionVisitor.ContextItemType contextItemType)
                        throws XPathException

      Optimize the function (may modify it)
      Parameters:
        `visitor` - the expression visitor, supplies context information
        `contextItemType` - the context item type at the point where the function definition appears
      Throws:
        `XPathException`

    - #### explain

          public void explain(ExpressionPresenter out)

    - #### deepEquals

          public 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
      Specified by:
        `deepEquals` in interface `FunctionItem`
      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.