com.icl.saxon.functions

Class FormatNumber

public class FormatNumber extends Function

Method Summary
Valueevaluate(Context c)
Evaluate in a general context
StringevaluateAsString(Context context)
Evaluate in a context where a string is wanted
StringformatNumber(double n, String format, DecimalFormatSymbols dfs)
Here is the method that does the work.
intgetDataType()
Determine the data type of the exprEssion
intgetDependencies()
Determine the dependencies
StringgetName()
Expressionreduce(int dep, Context c)
Reduce the dependencies
Expressionsimplify()
Simplify and validate

Method Detail

evaluate

public Value evaluate(Context c)
Evaluate in a general context

evaluateAsString

public String evaluateAsString(Context context)
Evaluate in a context where a string is wanted

formatNumber

public String formatNumber(double n, String format, DecimalFormatSymbols dfs)
Here is the method that does the work. It needs to be synchronized because it remembers information from one invocation to the next; it doesn't matter if these are in different threads but it can't be interrupted. The reason for remembering information is that getting a new DecimalFormatSymbols each time is incredibly expensive, especially with the Microsoft Java VM. Actually the synchronization is unnecessary if there is a bound Controller.

getDataType

public int getDataType()
Determine the data type of the exprEssion

Returns: Value.STRING

getDependencies

public int getDependencies()
Determine the dependencies

getName

public String getName()

reduce

public Expression reduce(int dep, Context c)
Reduce the dependencies

simplify

public Expression simplify()
Simplify and validate