2.17.2: 2011-06-17

net.sf.basedb.util.formatter
Class WellCoordinateFormatter

java.lang.Object
  extended by net.sf.basedb.util.formatter.WellCoordinateFormatter
All Implemented Interfaces:
Formatter<Integer>

public class WellCoordinateFormatter
extends Object
implements Formatter<Integer>

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: 2009-03-27 11:14:41 +0100 (Fri, 27 Mar 2009) $

Field Summary
private  boolean toAlpha
           
 
Constructor Summary
WellCoordinateFormatter(boolean toAlpha)
          Create a well coordinate formatter.
 
Method Summary
 String format(Integer value)
          Format a value by converting it to a string.
 Integer parseString(String value)
          Parse a string and return a value of the correct type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toAlpha

private boolean toAlpha
Constructor Detail

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 Detail

format

public String format(Integer value)
Description copied from interface: Formatter
Format a value by converting it to a string.

Specified by:
format in interface Formatter<Integer>
Parameters:
value - The value to format
Returns:
A formatted string

parseString

public Integer parseString(String value)
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 interface Formatter<Integer>
Parameters:
value - The string to parse
Returns:
An object

2.17.2: 2011-06-17