Class MemoFunction

  extended by net.sf.saxon.expr.instruct.Procedure
      extended by net.sf.saxon.expr.instruct.UserFunction
          extended by com.saxonica.expr.MemoFunction
All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, Container, InstructionInfo, Locator

public class MemoFunction
extends UserFunction

A user-defined function that is declared as a memo function, meaning that it remembers results of previous calls.

See Also:
Serialized Form

Field Summary
Fields inherited from class net.sf.saxon.expr.instruct.UserFunction
Fields inherited from class net.sf.saxon.expr.instruct.Procedure
Constructor Summary
Method Summary
 ValueRepresentation call(ValueRepresentation[] actualArgs, XPathContextMajor context)
          Call this function to return a value.
 void computeEvaluationMode()
          Determine the preferred evaluation mode for this function
 boolean isMemoFunction()
          Ask whether this function is a memo function
Methods inherited from class net.sf.saxon.expr.instruct.UserFunction
call, callUpdating, containsTailCalls, gatherDirectContributingCallees, getArgumentType, getConstructType, getDeclaredResultType, getEvaluationMode, getFunctionName, getNumberOfArguments, getObjectName, getParameterDefinitions, getResultType, isInlineable, isTailRecursive, isUpdating, iterateEvents, process, setFunctionName, setInlineable, setParameterDefinitions, setResultType, setTailRecursive, setUpdating
Methods inherited from class net.sf.saxon.expr.instruct.Procedure
getBody, getColumnNumber, getColumnNumber, getContainerGranularity, getExecutable, getHostLanguage, getLineNumber, getLineNumber, getLocationProvider, getProperties, getProperty, getPublicId, getStackFrameMap, getSystemId, getSystemId, setBody, setExecutable, setHostLanguage, setLineNumber, setStackFrameMap, setSystemId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public MemoFunction()
Method Detail


public void computeEvaluationMode()
Determine the preferred evaluation mode for this function

computeEvaluationMode in class UserFunction


public boolean isMemoFunction()
Ask whether this function is a memo function

isMemoFunction in class UserFunction
true if this function is marked as a memo function


public ValueRepresentation call(ValueRepresentation[] actualArgs,
                                XPathContextMajor context)
                         throws XPathException
Call this function to return a value.

call in class UserFunction
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 a Closure to 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.
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.
a Value representing the result of the function.

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