Copyright© 2008-2022 Sitevision AB, all rights reserved.
public interface NumericFormatter
An instance of the Sitevision class implementing this interface can be obtained via
a builder created via FormatterBuilderFactory
.
Modifier and Type | Method and Description |
---|---|
String |
format(Object aObject)
Formats a Object value.
|
String |
formatDouble(double aNumber)
Formats a double value.
|
String |
formatLong(long aNumber)
Formats a long value.
|
Number |
parse(String aSource)
Parses a source string to a Number.
|
String formatDouble(double aNumber) throws ArithmeticException
This method is conceptually equivalent with java.text.NumberFormat.format(double)
.
aNumber
- a double valueArithmeticException
- if a mathematical operation failsString formatLong(long aNumber) throws ArithmeticException
This method is conceptually equivalent with java.text.NumberFormat.format(long)
.
aNumber
- a long valueArithmeticException
- if a mathematical operation failsString format(Object aObject) throws NullPointerException, IllegalArgumentException, ArithmeticException
This method is conceptually equivalent with java.text.NumberFormat.format(Object)
.
aObject
- a Object, typically a java.lang.NumberNullPointerException
- if aObject is nullIllegalArgumentException
- if aObject is of an unsupported type (e.g. not numerical)ArithmeticException
- if a mathematical operation failsNumber parse(String aSource) throws NullPointerException, ParseException
This method is conceptually equivalent with java.text.NumberFormat.parse(String)
.
aSource
- a string, typically the resulting string from a format operation of a formatter like thisNullPointerException
- if aSource is nullParseException
- if parsing of aSource failsSitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.