Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.icl.saxon.expr.Expression
com.icl.saxon.expr.Function
com.icl.saxon.functions.FormatNumber
public class FormatNumber
extends Function
Field Summary |
Fields inherited from class com.icl.saxon.expr.Expression | |
staticContext |
Method Summary | |
Value | |
String |
|
String |
|
int |
|
int |
|
String |
|
Expression | |
Expression |
|
Methods inherited from class com.icl.saxon.expr.Function | |
addArgument , checkArgumentCount , display , getName , getNumberOfArguments |
Methods inherited from class com.icl.saxon.expr.Expression | |
containsReferences , display , enumerate , evaluate , evaluateAsBoolean , evaluateAsNodeSet , evaluateAsNumber , evaluateAsString , getDataType , getDependencies , getStaticContext , indent , isContextDocumentNodeSet , make , outputStringValue , reduce , setStaticContext , simplify , usesCurrent |
public Value evaluate(Context c) throws XPathException
Evaluate in a general context
- Overrides:
- evaluate in interface Expression
public String evaluateAsString(Context context) throws XPathException
Evaluate in a context where a string is wanted
- Overrides:
- evaluateAsString in interface Expression
public String formatNumber(double n, String format, DecimalFormatSymbols dfs) throws XPathException
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.
public int getDataType()
Determine the data type of the exprEssion
- Overrides:
- getDataType in interface Expression
- Returns:
- Value.STRING
public int getDependencies()
Determine the dependencies
- Overrides:
- getDependencies in interface Expression
public Expression reduce(int dep, Context c) throws XPathException
Reduce the dependencies
- Overrides:
- reduce in interface Expression
public Expression simplify() throws XPathException
Simplify and validate
- Overrides:
- simplify in interface Expression