Package net.sf.basedb.util.formatter
Class NumberFormatFormatter
java.lang.Object
net.sf.basedb.util.formatter.NumberFormatFormatter
- All Implemented Interfaces:
ExcelFormatter<Number,
,Number> Formatter<Number>
public class NumberFormatFormatter
extends Object
implements Formatter<Number>, ExcelFormatter<Number,Number>
Formatter implementation for numeric values that simply wrap a
NumberFormat instance.
- Since:
- 3.15
- Author:
- nicklas
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionFormat a value by converting it to a string.parseString
(String value) Parse a string and return a value of the correct type.toExcelValue
(Number value) Convert and format the given value to an Excel value.
-
Field Details
-
format
-
-
Constructor Details
-
NumberFormatFormatter
Create a new number formatter.
-
-
Method Details
-
format
Description copied from interface:Formatter
Format a value by converting it to a string. -
parseString
Description copied from interface:Formatter
Parse a string and return a value of the correct type. A null input string should (unless otherwise documented by a specific formatter implementation) be allowed and may return null or any other "default" value.- Specified by:
parseString
in interfaceFormatter<Number>
- Parameters:
value
- The string to parse- Returns:
- An object
-
toExcelValue
Description copied from interface:ExcelFormatter
Convert and format the given value to an Excel value. If the value is null the implementation may return null to create an empty cell or it may return another non-null value.- Specified by:
toExcelValue
in interfaceExcelFormatter<Number,
Number>
-