com.icl.saxon.functions
Class NumberFn

java.lang.Object
  |
  +--com.icl.saxon.expr.Expression
        |
        +--com.icl.saxon.expr.Function
              |
              +--com.icl.saxon.functions.NumberFn

public class NumberFn
extends Function


Fields inherited from class com.icl.saxon.expr.Function
arguments
 
Fields inherited from class com.icl.saxon.expr.Expression
emptyVector, staticContext
 
Constructor Summary
NumberFn()
           
 
Method Summary
 Value eval(java.util.Vector args, Context context)
          Evaluate the function, having evaluated its arguments.
 int getDataType()
          Determine the data type of the exprssion, if possible
 int getIntrinsicDependencies()
          Determine which aspects of the context the expression depends on.
 java.lang.String getName()
          Get the name of the function.
 boolean isNumeric()
          Determine whether the return the type of the expression is numeric.
protected  Expression reduceIntrinsic(int dependencies, Context context)
          Remove intrinsic dependencies.
 Expression simplify()
          Simplify an expression
 
Methods inherited from class com.icl.saxon.expr.Function
addArgument, checkArgumentCount, evaluate, getDependencies, newInstance, reduce, simplifyPureFunction, toString
 
Methods inherited from class com.icl.saxon.expr.Expression
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getStaticContext, isRelative, make, make, setStaticContext, usesCurrent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberFn

public NumberFn()
Method Detail

getName

public java.lang.String getName()
Description copied from class: Function
Get the name of the function. This method must be implemented in all subclasses.
Overrides:
getName in class Function
Following copied from class: com.icl.saxon.expr.Function
Returns:
the name of the function, as used in XSL expressions, but excluding its namespace prefix

getDataType

public int getDataType()
Determine the data type of the exprssion, if possible
Overrides:
getDataType in class Expression
Returns:
Value.NUMBER

isNumeric

public boolean isNumeric()
Description copied from class: Expression
Determine whether the return the type of the expression is numeric.
This information is needed if the expression is used as a filter in a path expression or pattern. If false, the value MAY be numeric (e.g. a variable reference)
Overrides:
isNumeric in class Expression
Following copied from class: com.icl.saxon.expr.Expression
Returns:
true if the expression will definitely return a numeric value.

getIntrinsicDependencies

public int getIntrinsicDependencies()
Determine which aspects of the context the expression depends on. The result is a bitwise-or'ed value composed from constants such as Context.VARIABLES and Context.CURRENT_NODE
Overrides:
getIntrinsicDependencies in class Function

reduceIntrinsic

protected Expression reduceIntrinsic(int dependencies,
                                     Context context)
                              throws org.xml.sax.SAXException
Remove intrinsic dependencies.
Overrides:
reduceIntrinsic in class Function

simplify

public Expression simplify()
                    throws org.xml.sax.SAXException
Description copied from class: Function
Simplify an expression
Overrides:
simplify in class Function
Following copied from class: com.icl.saxon.expr.Function
Returns:
the simplified expression

eval

public Value eval(java.util.Vector args,
                  Context context)
           throws org.xml.sax.SAXException
Description copied from class: Function
Evaluate the function, having evaluated its arguments.
This method must be implemented in all subclasses.
Overrides:
eval in class Function
Following copied from class: com.icl.saxon.expr.Function
Parameters:
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 evaluated
Returns:
a Value representing the result of the function. This must be of the data type corresponding to the result of getType().
Throws:
org.xml.sax.SAXException - if the function cannot be evaluated.