|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.parser.ColumnMapper
public class ColumnMapper
Returns the string found in the column given by the index set in the constructor. If the index is larger than the number of columns, an empty string is returned.
Field Summary | |
---|---|
private int |
index
|
private String |
name
|
private boolean |
nullIfException
|
private NumberFormat |
parser
|
private ParsePosition |
pos
|
Constructor Summary | |
---|---|
ColumnMapper(int index,
String name)
Create a new column mapper. |
|
ColumnMapper(int index,
String name,
NumberFormat parser)
Deprecated. Use ColumnMapper(int, String, NumberFormat, boolean) |
|
ColumnMapper(int index,
String name,
NumberFormat parser,
boolean nullIfException)
Create a new column mapper using a specific number format. |
Method Summary | |
---|---|
private Double |
getDouble(String value)
|
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 in the data objects column with the index specified in the constructor. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final int index
private final String name
private final NumberFormat parser
private final ParsePosition pos
private final boolean nullIfException
Constructor Detail |
---|
public ColumnMapper(int index, String name)
index
- The index of the data column to use, starting at 0name
- An optional name of the column, use in the toString
methodpublic ColumnMapper(int index, String name, NumberFormat parser)
ColumnMapper(int, String, NumberFormat, boolean)
public ColumnMapper(int index, String name, NumberFormat parser, boolean nullIfException)
index
- The index of the data column to use, starting at 0name
- An optional name of the column, use in the toString
methodnullIfException
- If TRUE, the mapper returns null for unparsable numeric
values, otherwise an excption is thrownparser
- The parser to use or null to use Double.valueOf()Method Detail |
---|
public String getValue(FlatFileParser.Data data)
getValue
in interface Mapper
data
- The line of data
public Integer getInt(FlatFileParser.Data data)
Mapper
getInt
in interface Mapper
data
- The line of data
public Float getFloat(FlatFileParser.Data data)
Mapper
getFloat
in interface Mapper
data
- The line of data
public String toString()
toString
in class Object
private Double getDouble(String value)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |