Interface IFunction
-
- All Known Implementing Classes:
AbstractFunction
,DefaultFunction
public interface IFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IFunction.Builder
static class
IFunction.FunctionProperty
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
arity()
Determine the number of arguments the function has.static IFunction.Builder
builder()
ISequence<?>
execute(List<ISequence<?>> arguments, DynamicContext dynamicContext, ISequence<?> focus)
List<IArgument>
getArguments()
Retrieve the list of function arguments.String
getName()
Retrieve the name of the function.String
getNamespace()
Retrieve the namespace of the function.Set<IFunction.FunctionProperty>
getProperties()
Retrieve the set of assigned function properties.default QName
getQName()
Retrieve the namespace qualified name of the function.ISequenceType
getResult()
Retrieve the function result sequence type.default boolean
isArityUnbounded()
Determines if the final argument can be repeated.default boolean
isContextDepenent()
Determines if the result of the function call depends on property values within the static or dynamic context and the provided arguments.default boolean
isDeterministic()
Determines if the result of the function call will produce identical results when provided the same implicit or explicit arguments.default boolean
isFocusDepenent()
Determines if the result of the function call depends on the current focus.String
toSignature()
Get the signature of the function as a string.
-
-
-
Method Detail
-
getNamespace
@NonNull String getNamespace()
Retrieve the namespace of the function.- Returns:
- the function's namespace
-
getQName
@NonNull default QName getQName()
Retrieve the namespace qualified name of the function.- Returns:
- the namespace qualified name
-
getProperties
@NonNull Set<IFunction.FunctionProperty> getProperties()
Retrieve the set of assigned function properties.- Returns:
- the set of properties or an empty set
-
getArguments
@NonNull List<IArgument> getArguments()
Retrieve the list of function arguments.- Returns:
- the function arguments or an empty list if there are none
-
arity
int arity()
Determine the number of arguments the function has.- Returns:
- the number of function arguments
-
isDeterministic
default boolean isDeterministic()
Determines if the result of the function call will produce identical results when provided the same implicit or explicit arguments.- Returns:
true
if function is deterministic orfalse
otherwise- See Also:
IFunction.FunctionProperty.DETERMINISTIC
-
isContextDepenent
default boolean isContextDepenent()
Determines if the result of the function call depends on property values within the static or dynamic context and the provided arguments.- Returns:
true
if function is context dependent orfalse
otherwise- See Also:
IFunction.FunctionProperty.CONTEXT_DEPENDENT
-
isFocusDepenent
default boolean isFocusDepenent()
Determines if the result of the function call depends on the current focus.- Returns:
true
if function is focus dependent orfalse
otherwise- See Also:
IFunction.FunctionProperty.FOCUS_DEPENDENT
-
isArityUnbounded
default boolean isArityUnbounded()
Determines if the final argument can be repeated.- Returns:
true
if the final argument can be repeated orfalse
otherwise- See Also:
IFunction.FunctionProperty.UNBOUNDED_ARITY
-
getResult
@NonNull ISequenceType getResult()
Retrieve the function result sequence type.- Returns:
- the function result sequence type
-
execute
@NonNull ISequence<?> execute(@NonNull List<ISequence<?>> arguments, @NonNull DynamicContext dynamicContext, @NonNull ISequence<?> focus) throws MetapathException
- Throws:
MetapathException
-
toSignature
String toSignature()
Get the signature of the function as a string.- Returns:
- the signature
-
builder
@NonNull static IFunction.Builder builder()
-
-