Interface IFunction
-
- All Known Implementing Classes:
AbstractFunction,DefaultFunction
public interface IFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIFunction.Builderstatic classIFunction.FunctionProperty
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intarity()Determine the number of arguments the function has.static IFunction.Builderbuilder()ISequence<?>execute(List<ISequence<?>> arguments, DynamicContext dynamicContext, ISequence<?> focus)List<IArgument>getArguments()Retrieve the list of function arguments.StringgetName()Retrieve the name of the function.StringgetNamespace()Retrieve the namespace of the function.Set<IFunction.FunctionProperty>getProperties()Retrieve the set of assigned function properties.default QNamegetQName()Retrieve the namespace qualified name of the function.ISequenceTypegetResult()Retrieve the function result sequence type.default booleanisArityUnbounded()Determines if the final argument can be repeated.default booleanisContextDepenent()Determines if the result of the function call depends on property values within the static or dynamic context and the provided arguments.default booleanisDeterministic()Determines if the result of the function call will produce identical results when provided the same implicit or explicit arguments.default booleanisFocusDepenent()Determines if the result of the function call depends on the current focus.StringtoSignature()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:
trueif function is deterministic orfalseotherwise- 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:
trueif function is context dependent orfalseotherwise- See Also:
IFunction.FunctionProperty.CONTEXT_DEPENDENT
-
isFocusDepenent
default boolean isFocusDepenent()
Determines if the result of the function call depends on the current focus.- Returns:
trueif function is focus dependent orfalseotherwise- See Also:
IFunction.FunctionProperty.FOCUS_DEPENDENT
-
isArityUnbounded
default boolean isArityUnbounded()
Determines if the final argument can be repeated.- Returns:
trueif the final argument can be repeated orfalseotherwise- 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()
-
-