Package net.sf.basedb.util.formatter
Class WellCoordinateFormatter
java.lang.Object
net.sf.basedb.util.formatter.WellCoordinateFormatter
- All Implemented Interfaces:
ExcelFormatter<Integer,
,Object> Formatter<Integer>
public class WellCoordinateFormatter
extends Object
implements Formatter<Integer>, ExcelFormatter<Integer,Object>
Formats an internal well coordinate to an external coordinate. There
are two variants. One that converts to alphabetic values:
0 -> A, 1 -> B, and so on. And one that converts between 0-based
and 1-based coordinates.
- Version:
- 2.12
- Author:
- nicklas
- Last modified
- $Date: 2019-03-13 15:33:25 +0100 (ons, 13 mars 2019) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWellCoordinateFormatter
(boolean toAlpha) Create a well coordinate formatter. -
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
(Integer value) Convert and format the given value to an Excel value.
-
Field Details
-
toAlpha
private boolean toAlpha
-
-
Constructor Details
-
WellCoordinateFormatter
public WellCoordinateFormatter(boolean toAlpha) Create a well coordinate formatter.- Parameters:
toAlpha
- TRUE to convert to alphabetic coordinates, FALSE to convert from 0-based to 1-based coordinates
-
-
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<Integer>
- 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<Integer,
Object>
-