|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.expr.Expression | +--com.icl.saxon.expr.Function
Abstract superclass for system-defined and user-defined functions
Field Summary | |
protected java.util.Vector |
arguments
|
Fields inherited from class com.icl.saxon.expr.Expression |
emptyVector, staticContext |
Constructor Summary | |
Function()
|
Method Summary | |
void |
addArgument(Expression expr)
Method to add an argument during function definition. |
protected int |
checkArgumentCount(int min,
int max)
Check number of arguments. |
abstract Value |
eval(java.util.Vector arguments,
Context context)
Evaluate the function, having evaluated its arguments. |
Value |
evaluate(Context c)
Evaluate the function: evaluate the arguments, then call the function's eval() method |
int |
getDependencies()
Determine which aspects of the context the expression depends on. |
int |
getIntrinsicDependencies()
Get the intrinsic dependencies for the function, independent of the arguments |
abstract java.lang.String |
getName()
Get the name of the function. |
Function |
newInstance()
Make a new instance of this function |
Expression |
reduce(int dependencies,
Context context)
Perform a partial evaluation of the expression, by eliminating specified dependencies on the context. |
protected Expression |
reduceIntrinsic(int dependencies,
Context context)
Remove intrinsic dependencies. |
Expression |
simplify()
Simplify an expression |
Expression |
simplifyPureFunction()
Method to simplify a pure function, ie. |
java.lang.String |
toString()
Get a string representation of the function call |
Methods inherited from class com.icl.saxon.expr.Expression |
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getDataType, getStaticContext, isNumeric, isRelative, make, make, setStaticContext, usesCurrent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector arguments
Constructor Detail |
public Function()
Method Detail |
public void addArgument(Expression expr)
public abstract java.lang.String getName()
public Expression simplify() throws org.xml.sax.SAXException
simplify
in class Expression
public Expression simplifyPureFunction() throws org.xml.sax.SAXException
public Value evaluate(Context c) throws org.xml.sax.SAXException
evaluate
in class Expression
com.icl.saxon.expr.Expression
context
- The context in which the expression is to be evaluatedpublic int getIntrinsicDependencies()
public int getDependencies()
getDependencies
in class Expression
public Expression reduce(int dependencies, Context context) throws org.xml.sax.SAXException
reduce
in class Expression
dependencies
- The dependencies to be removedcontext
- The context to be used for the partial evaluationpublic Function newInstance() throws org.xml.sax.SAXException
protected Expression reduceIntrinsic(int dependencies, Context context) throws org.xml.sax.SAXException
public abstract Value eval(java.util.Vector arguments, Context context) throws org.xml.sax.SAXException
arguments
- A Vector, each of whose elements is a Value containing the value of a
supplied argument to the function.context
- The context in which the function is to be evaluatedorg.xml.sax.SAXException
- if the function cannot be evaluated.public java.lang.String toString()
toString
in class java.lang.Object
protected int checkArgumentCount(int min, int max) throws org.xml.sax.SAXException
min
- the minimum number of arguments allowedmax
- the maximum number of arguments allowedorg.xml.sax.SAXException
- if the number of arguments is out of range
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |