net.sf.saxon.om
Interface FunctionItem

All Superinterfaces:
Item, PullEvent, Serializable, ValueRepresentation
All Known Implementing Classes:
AbstractFunctionItem, CoercedFunction, CurriedFunction, FirstClassFunction, UserFunctionItem

public interface FunctionItem
extends Item, Serializable

XQuery 1.1 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.


Field Summary
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Method Summary
 FunctionItem curry(int arg, ValueRepresentation value)
          Curry a function by binding one of its arguments
 int getArity()
          Get the arity of the function
 FunctionItemType getFunctionItemType()
          Get the item type of the function item
 StructuredQName getFunctionName()
          Get the name of the function, or null if it is anonymous
 SequenceIterator invoke(SequenceIterator[] args, XPathContext context)
          Invoke the function
 
Methods inherited from interface net.sf.saxon.om.Item
getStringValue, getStringValueCS, getTypedValue
 

Method Detail

getFunctionItemType

FunctionItemType getFunctionItemType()
Get the item type of the function item

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

invoke

SequenceIterator invoke(SequenceIterator[] args,
                        XPathContext context)
                        throws XPathException
Invoke the function

Parameters:
args - the actual arguments to be supplied
context - the XPath dynamic evaluation context
Returns:
the result of invoking the function
Throws:
XPathException

curry

FunctionItem curry(int arg,
                   ValueRepresentation value)
                   throws XPathException
Curry a function by binding one of its arguments

Parameters:
arg - the argument to be found (1-based)
value - the value to which the argument is to be bound
Throws:
XPathException


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