Package pulse.io.readers
Class TBLReader
- java.lang.Object
-
- pulse.io.readers.TBLReader
-
- All Implemented Interfaces:
AbstractHandler,AbstractReader<InterpolationDataset>,DatasetReader,Reflexive
public class TBLReader extends Object implements DatasetReader
ADatasetReadercapable of reading.tblfiles.The format of these files is simply two tab-delimited numeric column. The first column represents the 'keys', and the second -- the corresponding 'values'.
Specific heat capacity and density at different temperatures can be read as
ASCIIfiles with a .tbl suffix, where the first column is temperature (in degrees Celsius) and the second column is the specific heat capacity (in J kg-1 K-1) or density (in kg m-3).Below is an example of a valid
.tblfile:-273 11000.00 0 10959.84 50 10943.82 100 10927.80 150 10911.77 200 10895.73 250 10879.67 300 10863.56 350 10847.41 400 10831.21 450 10814.93 500 10798.58 550 10782.14
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DatasetReadergetInstance()As this class is built using a singleton pattern, only one instance exists.StringgetSupportedExtension()Retrieves the supported extension of files, which thisAbstractHandleris able to process.InterpolationDatasetread(File file)Reads through afilewith.tbl extension, converting each row into anImmutableDataEntry<Double,Double>, which is then added to a newly createdInterpolationDataset.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface pulse.io.readers.AbstractHandler
isExtensionSupported
-
-
-
-
Method Detail
-
getSupportedExtension
public String getSupportedExtension()
Description copied from interface:AbstractHandlerRetrieves the supported extension of files, which thisAbstractHandleris able to process.- Specified by:
getSupportedExtensionin interfaceAbstractHandler- Returns:
- a String equal to '
tbl'
-
getInstance
public static DatasetReader getInstance()
As this class is built using a singleton pattern, only one instance exists.- Returns:
- the static instance of this class
-
read
public InterpolationDataset read(File file) throws IOException
Reads through afilewith.tbl extension, converting each row into anImmutableDataEntry<Double,Double>, which is then added to a newly createdInterpolationDataset. Upon completion, thedoInterpolation()method ofInterpolationDatasetis invoked.- Specified by:
readin interfaceAbstractReader<InterpolationDataset>- Specified by:
readin interfaceDatasetReader- Parameters:
file- aFilewithtblextension- Returns:
- an
InterpolationDataset, which not only stores the information contained infile, but also provides means of interpolation. - Throws:
IOException- if something goes wrong with reading thefile
-
-