Package net.sf.saxon.expr.instruct
Class MemoFunction
java.lang.Object
net.sf.saxon.expr.instruct.Actor
net.sf.saxon.expr.instruct.UserFunction
net.sf.saxon.expr.instruct.MemoFunction
- All Implemented Interfaces:
SourceLocator,Callable,ContextOriginator,ExpressionOwner,Locatable,Function,GroundedValue,Item,Sequence,Location,Traceable,TraceableComponent,Locator
A user-defined function that is declared as a memo function, meaning that it remembers results
of previous calls.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.saxon.expr.instruct.UserFunction
UserFunction.Determinism -
Field Summary
Fields inherited from class net.sf.saxon.expr.instruct.UserFunction
evaluator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(XPathContext context, Sequence[] actualArgs) Call this function to return a value.voidDetermine the preferred evaluation mode for this functionbooleanAsk whether this function is a memo functionMethods inherited from class net.sf.saxon.expr.instruct.UserFunction
acceptsNodesWithoutAtomization, atomize, call, callUpdating, containsTailCalls, deepEquals, effectiveBooleanValue, export, gatherProperties, getAnnotations, getArgumentType, getArity, getDeclaredResultType, getDeclaredStreamability, getDescription, getDeterminism, getEvaluator, getFunctionItemType, getFunctionName, getLength, getObjectName, getOperandRoles, getParameterDefinitions, getReferenceCount, getResultType, getStringValue, getStringValueCS, getSymbolicName, getTracingTag, head, incrementReferenceCount, isArray, isExportable, isInlineable, isMap, isOverrideExtensionFunction, isTailRecursive, isTrustedResultType, isUpdating, itemAt, makeNewContext, markAsInlined, prepareForStreaming, process, reduce, setAnnotations, setDeclaredStreamability, setDeterminism, setEvaluationMode, setFunctionName, setInlineable, setOverrideExtensionFunction, setParameterDefinitions, setResultType, setTailRecursive, setUpdating, subsequence, typeCheckMethods inherited from class net.sf.saxon.expr.instruct.Actor
allocateAllBindingSlots, allocateBindingSlotsRecursive, getBody, getChildExpression, getColumnNumber, getComponentName, getDeclaredVisibility, getDeclaringComponent, getLineNumber, getLocation, getPackageData, getProperties, getProperty, getPublicId, getRetainedStaticContext, getStackFrameMap, getSystemId, makeDeclaringComponent, obtainDeclaringComponent, saveLocation, setBody, setChildExpression, setColumnNumber, setDeclaredVisibility, setDeclaringComponent, setLineNumber, setPackageData, setRetainedStaticContext, setStackFrameMap, setSystemIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.om.Function
getGenre, toShortStringMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materializeMethods inherited from interface net.sf.saxon.om.Item
isStreamed, iterateMethods inherited from interface net.sf.saxon.expr.Locatable
getLocationMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatableMethods inherited from interface net.sf.saxon.trace.TraceableComponent
getBody, setBody
-
Constructor Details
-
MemoFunction
public MemoFunction()
-
-
Method Details
-
computeEvaluationMode
public void computeEvaluationMode()Determine the preferred evaluation mode for this function- Overrides:
computeEvaluationModein classUserFunction
-
isMemoFunction
public boolean isMemoFunction()Ask whether this function is a memo function- Overrides:
isMemoFunctionin classUserFunction- Returns:
- true if this function is marked as a memo function
-
call
Call this function to return a value.- Specified by:
callin interfaceCallable- Specified by:
callin interfaceFunction- Overrides:
callin classUserFunction- Parameters:
context- This provides the run-time context for evaluating the function. It is the caller's responsibility to allocate a "clean" context for the function to use; the context that is provided will be overwritten by the function.actualArgs- the arguments supplied to the function. These must have the correct types required by the function signature (it is the caller's responsibility to check this). It is acceptable to supply aClosureto represent a value whose evaluation will be delayed until it is needed. The array must be the correct size to match the number of arguments: again, it is the caller's responsibility to check this.- Returns:
- a Value representing the result of the function.
- Throws:
XPathException- if a dynamic error occurs while evaluating the function
-