2.17.2: 2011-06-17

net.sf.basedb.util.parser
Interface Mapper

All Known Implementing Classes:
ColumnMapper, CompoundMapper, ConstantMapper, CropStringMapper, JepMapper, NullIfExceptionMapper

public interface Mapper

Represents a mapping expression that gets a single value from a line of data. A typical mapping expression holds a reference to the column number or name, for example:

\1\
\row\
Row: \row\, Col:\col\
=2 * col('Radius')
The actual syntax for the mapping string depends on the parser used.

Version:
2.0
Author:
Nicklas
See Also:
FlatFileParser.getMapper(String)
Last modified
$Date: 2008-09-11 22:08:14 +0200 (Thu, 11 Sep 2008) $

Method Summary
 Float getFloat(FlatFileParser.Data data)
          Get the value for the line of data as a float.
 Integer getInt(FlatFileParser.Data data)
          Get the value for the line of data as an integer.
 String getValue(FlatFileParser.Data data)
          Get the value for the line of data.
 

Method Detail

getValue

String getValue(FlatFileParser.Data data)
Get the value for the line of data.

Parameters:
data - The line of data
Returns:
A string value

getInt

Integer getInt(FlatFileParser.Data data)
Get the value for the line of data as an integer.

Parameters:
data - The line of data
Returns:
The value as an integer
Throws:
NumberFormatException - If the value can't be parsed as an integer

getFloat

Float getFloat(FlatFileParser.Data data)
Get the value for the line of data as a float.

Parameters:
data - The line of data
Returns:
The value as a float
Throws:
NumberFormatException - If the value can't be parsed as a float

2.17.2: 2011-06-17