hepdata is hosted by Hepforge, IPPP Durham

cedar.hepdata.file
Class HDObjectReader

java.lang.Object
  extended by cedar.hepdata.file.HDFileReader
      extended by cedar.hepdata.file.HDObjectReader

public class HDObjectReader
extends HDFileReader

Reads and Decodes flat data files to populate the object model.

Version:
$Date: 2006-02-02 15:28:29 +0000 (Thu, 02 Feb 2006) $ $Revision: 494 $
Author:
S Butterworth

Field Summary
 
Fields inherited from class cedar.hepdata.file.HDFileReader
errString, format, format1, format11, format2, formatYear, RTN_DELIMS, TOK_DELIM
 
Constructor Summary
HDObjectReader(java.lang.String inputfile)
          Constructor requires the name of the data file to be read.
 
Method Summary
 void fill(Axis axis)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Dataset dataset)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Detector detector)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Experiment experiment)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Observable observable)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Paper paper)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Qualifier qualifier)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Reaction reaction)
          Populates the input object with fields read consecutively from a line of the input data.
 void fill(Reference reference)
          Populates the input object with fields read consecutively from a line of the input data.
 int readDatasets()
          Read data file, creating a new dataset object for each row.
 int readDetectors()
          Read data file, creating a new detector object for each row.
 int readExperiments()
          Read data file, creating a new experiment object for each row.
 int readObservables()
          Read data file, creating a new observable object for each row.
 int readPapers()
          Read data file, creating a new paper object for each row.
 int readReactions()
          Read data file, creating a new reaction object for each row.
 int readReferences()
          Read data file, creating a new reference object for each row.
 int readScalefactor()
          Read data file, creating a new scalefactor object for each row.
 int readSystematics()
          Read data file, creating a new systematics object for each row.
 int readXAxes()
          Read data file, creating a new xaxis object for each row.
 int readXValues()
          Read data file, creating a new XAxis object for each row Each row contains an XVal.
 int readYAxes()
          Read data file, creating a new yaxis object for each row.
 int readYValues()
          Read data file, creating a new YAxis object for each row Each row contains an YVal.
 
Methods inherited from class cedar.hepdata.file.HDFileReader
getDescription, readDate, readDouble, readInt, readInteger, readString, readStringNoComment, readYear, resetReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HDObjectReader

public HDObjectReader(java.lang.String inputfile)
Constructor requires the name of the data file to be read.

Parameters:
inputfile - data file name with path

Method Detail

readReactions

public int readReactions()
Read data file, creating a new reaction object for each row.

Returns:
count records processed successfully


fill

public void fill(Reaction reaction)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data. Also populates collection of final particles on the reaction.

Parameters:
reaction - to be populated
Throws:
HDException


readObservables

public int readObservables()
Read data file, creating a new observable object for each row.

Returns:
count records processed successfully


fill

public void fill(Observable observable)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data.

Parameters:
observable - to be populated
Throws:
HDException


readPapers

public int readPapers()
Read data file, creating a new paper object for each row.

Returns:
count records processed successfully


fill

public void fill(Paper paper)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data.

Parameters:
paper - to be populated
Throws:
HDException


readDatasets

public int readDatasets()
Read data file, creating a new dataset object for each row.

Returns:
count records processed successfully


fill

public void fill(Dataset dataset)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data. If the input is a 'qualifier' file, only id fields plus header and description will be populated. These values are intended to be used to update an existing record in the database.

Parameters:
dataset - to be populated
Throws:
HDException


readXAxes

public int readXAxes()
Read data file, creating a new xaxis object for each row.

Returns:
count records processed successfully


readYAxes

public int readYAxes()
Read data file, creating a new yaxis object for each row.

Returns:
count records processed successfully


fill

public void fill(Axis axis)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data. The process is the same for X and Y axes except that Y axis has a description. This method is used for axis and value migrations. For value migrations, readVal=true and each input line represents a new value, to be stored on the current axis object "refAx". When a value is encountered not belonging to "refAx", the "refAx" collection of values is saved and a new collection is started.

Parameters:
axis - to be populated
Throws:
HDException


readXValues

public int readXValues()
Read data file, creating a new XAxis object for each row Each row contains an XVal. These are stored on an XAxis and saved when the set is completed.

Returns:
count records processed successfully


readYValues

public int readYValues()
Read data file, creating a new YAxis object for each row Each row contains an YVal. These are stored on an YAxis and saved when the set is completed.

Returns:
count records processed successfully


readReferences

public int readReferences()
Read data file, creating a new reference object for each row.

Returns:
count records processed successfully


fill

public void fill(Reference reference)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data.

Parameters:
reference - to be populated
Throws:
HDException


readDetectors

public int readDetectors()
Read data file, creating a new detector object for each row.

Returns:
count records processed successfully


fill

public void fill(Detector detector)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data.

Parameters:
detector - to be populated
Throws:
HDException


readExperiments

public int readExperiments()
Read data file, creating a new experiment object for each row.

Returns:
count records processed successfully


fill

public void fill(Experiment experiment)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data.

Parameters:
experiment - to be populated
Throws:
HDException


readSystematics

public int readSystematics()
Read data file, creating a new systematics object for each row.

Returns:
count records processed successfully


fill

public void fill(Qualifier qualifier)
          throws HDException
Populates the input object with fields read consecutively from a line of the input data. A Qualifier in this context is a dataset or axis level record such as systematic error or scalefactor.

Parameters:
qualifier - to be populated
Throws:
HDException


readScalefactor

public int readScalefactor()
Read data file, creating a new scalefactor object for each row.

Returns:
count records processed successfully


Generated 20060512 1623

HEPData