public class FormatNumber extends Function
staticContext| Constructor and Description |
|---|
FormatNumber() |
| Modifier and Type | Method and 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
|
addArgument, checkArgumentCount, display, getNumberOfArgumentscontainsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, setStaticContext, usesCurrentpublic java.lang.String getName()
Functionpublic int getDataType()
getDataType in class Expressionpublic Expression simplify() throws XPathException
simplify in class ExpressionXPathExceptionpublic java.lang.String evaluateAsString(Context context) throws XPathException
evaluateAsString in class Expressioncontext - The context in which the expression is to be evaluatedXPathExceptionpublic Value evaluate(Context c) throws XPathException
evaluate in class Expressionc - The context in which the expression is to be evaluatedXPathExceptionpublic java.lang.String formatNumber(double n,
java.lang.String format,
java.text.DecimalFormatSymbols dfs)
throws XPathException
XPathExceptionpublic int getDependencies()
getDependencies in class Expressionpublic Expression reduce(int dep, Context c) throws XPathException
reduce in class Expressiondep - The dependencies to be removed, e.g. Context.VARIABLESc - The context to be used for the partial evaluationXPathException