Package net.sf.saxon.om
Interface FunctionItem<T extends FunctionItem>
- All Superinterfaces:
Item<T>
,PullEvent
,ValueRepresentation<T>
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.
-
Field Summary
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptioncurry
(ValueRepresentation<? extends Item>[] values) Curry a function by binding one or more (but not all) of its argumentsboolean
deepEquals
(FunctionItem other, XPathContext context, GenericAtomicComparer comparer, int flags) Test whether this FunctionItem is deep-equal to another function item, under the rules of the deep-equal functionint
getArity()
Get the arity of the functionGet the item type of the function itemGet the name of the function, or null if it is anonymousSequenceIterator
<? extends Item> invoke
(SequenceIterator<? extends Item>[] args, XPathContext context) Invoke the functionMethods inherited from interface net.sf.saxon.om.Item
getStringValue, getStringValueCS, getTypedValue
-
Method Details
-
getFunctionItemType
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
-
invoke
SequenceIterator<? extends Item> invoke(SequenceIterator<? extends Item>[] args, XPathContext context) throws XPathException Invoke the function- Parameters:
args
- the actual arguments to be suppliedcontext
- the XPath dynamic evaluation context- Returns:
- the result of invoking the function
- Throws:
XPathException
- if a dynamic error occurs within the function
-
curry
Curry a function by binding one or more (but not all) of its arguments- Parameters:
values
- the values to which the arguments are to be bound, representing an unbound argument (a placeholder) by null- Returns:
- a new function item in which the specified arguments of the original function are bound to a value
- Throws:
XPathException
- if any dynamic error occurs
-
deepEquals
boolean deepEquals(FunctionItem other, XPathContext context, GenericAtomicComparer 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 itemcontext
- the dynamic evaluation contextcomparer
- the object to perform the comparisonflags
- 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
-