2.17.2: 2011-06-17

net.sf.basedb.util.importer.spotdata
Class ExtraFloatParser

java.lang.Object
  extended by net.sf.basedb.util.importer.spotdata.ExtraFloatParser

public class ExtraFloatParser
extends Object

Parser that is responsible for extracting extra float values from the 'spot' section in a BASEfile. Extra value parsers are created in the first pass and used in the second pass.

Version:
2.14
Author:
Nicklas
Last modified
$Date: 2009-09-10 14:36:54 +0200 (Thu, 10 Sep 2009) $

Field Summary
private  String id
           
private  int valueIndex
           
 
Constructor Summary
ExtraFloatParser(String id, int valueIndex)
          Creates a new extra value parser.
 
Method Summary
 String getId()
          Get the external id of the extra value type.
 float getValue(FlatFileParser.Data data, int firstIndex)
          Get the extra value from the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private final String id

valueIndex

private final int valueIndex
Constructor Detail

ExtraFloatParser

public ExtraFloatParser(String id,
                        int valueIndex)
Creates a new extra value parser.

Parameters:
id - The external id of the extra value type
valueIndex - The index of the extra value column relative the first column of assay data
Method Detail

getId

public String getId()
Get the external id of the extra value type.


getValue

public float getValue(FlatFileParser.Data data,
                      int firstIndex)
Get the extra value from the data. If the section contains data for multiple bioassays (eg. a matrix BASEfile) this method is called multiple times (with different 'firstIndex' value) for each row.

Parameters:
data - The current data line
firstIndex - The index of the first data column that contains data for the current bioassay
Returns:
The extracted float value, or Float.NaN if the value is invalid (results in not inserting it)

2.17.2: 2011-06-17