hepdata is hosted by Hepforge, IPPP Durham

cedar.hepdata.file
Class HDFileReader

java.lang.Object
  extended by cedar.hepdata.file.HDFileReader
Direct Known Subclasses:
HDObjectReader, HDValueReader

public abstract class HDFileReader
extends java.lang.Object

Reads and Decodes flat data files produced from legacy HEPData DB.

Version:
$Date: 2006-01-20 11:29:58 +0000 (Fri, 20 Jan 2006) $ $Revision: 466 $
Author:
S Butterworth

Field Summary
protected  java.lang.String errString
          string holding error data to be printed out
protected static java.text.DateFormat format
           
protected static java.text.DateFormat format1
           
protected static java.text.DateFormat format11
           
protected static java.text.DateFormat format2
           
protected static java.text.DateFormat formatYear
           
protected static boolean RTN_DELIMS
          specifies whether the tokens are output from the tokenizer, along with the fields they demarkate
protected static java.lang.String TOK_DELIM
          character separating individual fields in the input
 
Constructor Summary
HDFileReader()
           
 
Method Summary
protected  java.lang.String getDescription(java.util.StringTokenizer st)
          Formats description for YAxis migration, which is split over 2 fields in the input file
protected  java.util.Date readDate(java.util.StringTokenizer st)
          Converts an input field read from file into a Date.
protected  java.lang.Double readDouble(java.util.StringTokenizer st)
          Converts an input field read from file into a Double.
protected  int readInt(java.util.StringTokenizer st)
          Converts an input field read from file into an int.
protected  java.lang.Integer readInteger(java.util.StringTokenizer st)
          Converts an input field read from file into an Integer.
protected  java.lang.String readString(java.util.StringTokenizer st)
          Input field from a file is trimmed and returned as a String.
protected  java.lang.String readStringNoComment(java.util.StringTokenizer st)
          As readString() but comments of format "(C=.." and also "RE(Q=.." are trimmed off
protected  java.util.Date readYear(java.util.StringTokenizer st)
          Converts an input field read from file into a Date.
protected  void resetReader()
          to be called at the start of reading each line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOK_DELIM

protected static final java.lang.String TOK_DELIM
character separating individual fields in the input

See Also:
Constant Field Values


RTN_DELIMS

protected static final boolean RTN_DELIMS
specifies whether the tokens are output from the tokenizer, along with the fields they demarkate

See Also:
Constant Field Values


format

protected static java.text.DateFormat format

format1

protected static java.text.DateFormat format1

format11

protected static java.text.DateFormat format11

format2

protected static java.text.DateFormat format2

formatYear

protected static java.text.DateFormat formatYear

errString

protected java.lang.String errString
string holding error data to be printed out

Constructor Detail

HDFileReader

public HDFileReader()
Method Detail

getDescription

protected java.lang.String getDescription(java.util.StringTokenizer st)
Formats description for YAxis migration, which is split over 2 fields in the input file


readDate

protected java.util.Date readDate(java.util.StringTokenizer st)
                           throws java.text.ParseException
Converts an input field read from file into a Date. Several formats for the date are tolerated. Handles null value by returning null

Throws:
java.text.ParseException


readYear

protected java.util.Date readYear(java.util.StringTokenizer st)
                           throws java.text.ParseException
Converts an input field read from file into a Date. Several formats for the date are tolerated, including "YYYY" Handles null value by returning null

Throws:
java.text.ParseException


readInteger

protected java.lang.Integer readInteger(java.util.StringTokenizer st)
                                 throws java.lang.NumberFormatException
Converts an input field read from file into an Integer. Handles null value by returning null

Throws:
java.lang.NumberFormatException


readDouble

protected java.lang.Double readDouble(java.util.StringTokenizer st)
                               throws java.lang.NumberFormatException
Converts an input field read from file into a Double. Handles null value by returning null

Throws:
java.lang.NumberFormatException


readInt

protected int readInt(java.util.StringTokenizer st)
               throws java.lang.NumberFormatException
Converts an input field read from file into an int. Handles null value by returning 0

Throws:
java.lang.NumberFormatException


readString

protected java.lang.String readString(java.util.StringTokenizer st)
Input field from a file is trimmed and returned as a String. Handles null value by returning null


readStringNoComment

protected java.lang.String readStringNoComment(java.util.StringTokenizer st)
As readString() but comments of format "(C=.." and also "RE(Q=.." are trimmed off


resetReader

protected void resetReader()
to be called at the start of reading each line


Generated 20060512 1623

HEPData