hepdata is hosted by Hepforge, IPPP Durham

cedar.hepdata.file
Class HDValueReader

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

public class HDValueReader
extends HDFileReader

Reads and Decodes text data values to populate the object model Value and ErrorValue classes. Decoding these String values was the major challenge of the migration which is one reason for this task having its own seperate File Reader.

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
HDValueReader()
          empty constructor to be used for values not on an axis
HDValueReader(Axis axis)
          Constructor requires the Axis to which the values being decoded belong
 
Method Summary
static java.util.Vector<ErrorValue> getErrors(java.lang.String desc)
          A systematic error is input as a description string It is decoded into a collection of ErrorValues.
protected  Value getValue(int pointId, java.lang.String desc)
          Construction of a Value object from a text string.
 Value getValue(java.lang.String desc)
          Creates a value by decoding input string.
 
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

HDValueReader

public HDValueReader(Axis axis)
              throws java.lang.NumberFormatException
Constructor requires the Axis to which the values being decoded belong

Parameters:
axis - Axis for the values.
Throws:
java.lang.NumberFormatException


HDValueReader

public HDValueReader()
empty constructor to be used for values not on an axis

Method Detail

getValue

public Value getValue(java.lang.String desc)
               throws HDException
Creates a value by decoding input string. Calls getValue(null,desc). Used for decoding values from axis and dataset description strings. Should also populate errors on the value, where they exist. If it doesn't work, it may be necessary to write new code to do this job specifically.

Throws:
HDException


getValue

protected Value getValue(int pointId,
                         java.lang.String desc)
                  throws HDException
Construction of a Value object from a text string. This method reads in the Id and Description for the value. The description must be decoded into a numerical Value plus Error Values.

Parameters:
pointId - for the new Value
desc - text string representing the Value with Errors
Returns:
value
Throws:
HDException


getErrors

public static java.util.Vector<ErrorValue> getErrors(java.lang.String desc)
                                              throws HDException
A systematic error is input as a description string It is decoded into a collection of ErrorValues. Usually there will be only one ErrorValue in the collection, but 2 if upper and lower limits are specified.

Parameters:
desc - String of error values
Returns:
Vector of ErrorValue objects
Throws:
HDException


Generated 20060512 1623

HEPData