public class FormatNumber extends Function
staticContext
Constructor | Description |
---|---|
FormatNumber() |
Modifier and Type | Method | Description |
---|---|---|
Value |
evaluate(Context c) |
Evaluate in a general context
|
java.lang.String |
evaluateAsString(Context context) |
Evaluate in a context where a string is wanted
|
java.lang.String |
formatNumber(double n,
java.lang.String format,
java.text.DecimalFormatSymbols dfs) |
Here is the method that does the work.
|
int |
getDataType() |
Determine the data type of the exprEssion
|
int |
getDependencies() |
Determine the dependencies
|
java.lang.String |
getName() |
Get the name of the function.
|
Expression |
reduce(int dep,
Context c) |
Reduce the dependencies
|
Expression |
simplify() |
Simplify and validate
|
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, setStaticContext, usesCurrent
addArgument, checkArgumentCount, display, getNumberOfArguments
public java.lang.String getName()
Function
public int getDataType()
getDataType
in class Expression
public Expression simplify() throws XPathException
simplify
in class Expression
XPathException
public java.lang.String evaluateAsString(Context context) throws XPathException
evaluateAsString
in class Expression
context
- The context in which the expression is to be evaluatedXPathException
public Value evaluate(Context c) throws XPathException
evaluate
in class Expression
c
- The context in which the expression is to be evaluatedXPathException
public java.lang.String formatNumber(double n, java.lang.String format, java.text.DecimalFormatSymbols dfs) throws XPathException
XPathException
public int getDependencies()
getDependencies
in class Expression
public Expression reduce(int dep, Context c) throws XPathException
reduce
in class Expression
dep
- The dependencies to be removed, e.g. Context.VARIABLESc
- The context to be used for the partial evaluationXPathException