Package adams.data.io.input
Class ASCSpectrumReader.ParsedFile
- java.lang.Object
-
- adams.data.io.input.ASCSpectrumReader.ParsedFile
-
- Enclosing class:
- ASCSpectrumReader
protected class ASCSpectrumReader.ParsedFile extends Object
Class for parsing an ASC file.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
lastError
the last error that occurred.protected List
m_dp
vector of 2d double (double[2]) wavenumber,absorbance.protected boolean
m_ForceCommaToPoint
whether to force replacing comma with point.protected Hashtable<String,String>
m_ht
Name->Value, String->String. ie "Sample ID" -> "994370"
-
Constructor Summary
Constructors Modifier Constructor Description protected
ParsedFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getID()
Returns the ID.String
getLastError()
Returns the last error that occurred.double[]
getNIRArray()
Returns the NIR array.Integer
getNumDatapoints()
Returns the number of data points.Hashtable<String,String>
getProperties()
get hashtable property data.String
getType()
Returns the type.double[]
getWaveNumberArray()
Returns the Wave number array.boolean
parse(File afile)
Parses the given file.boolean
parse(String in)
Parses the given string.
-
-
-
Field Detail
-
m_ht
protected Hashtable<String,String> m_ht
Name->Value, String->String. ie "Sample ID" -> "994370"
-
m_dp
protected List m_dp
vector of 2d double (double[2]) wavenumber,absorbance.
-
lastError
protected String lastError
the last error that occurred.
-
m_ForceCommaToPoint
protected boolean m_ForceCommaToPoint
whether to force replacing comma with point.
-
-
Method Detail
-
getLastError
public String getLastError()
Returns the last error that occurred.- Returns:
- the last error
-
getType
public String getType()
Returns the type.- Returns:
- the type
-
getID
public String getID()
Returns the ID.- Returns:
- the ID
-
getNumDatapoints
public Integer getNumDatapoints()
Returns the number of data points.- Returns:
- the number of data points, or null if it can't be parsed
-
getWaveNumberArray
public double[] getWaveNumberArray()
Returns the Wave number array.- Returns:
- the array
-
getProperties
public Hashtable<String,String> getProperties()
get hashtable property data.- Returns:
- the hashtable
-
getNIRArray
public double[] getNIRArray()
Returns the NIR array.- Returns:
- the array
-
parse
public boolean parse(File afile)
Parses the given file.- Parameters:
afile
- the file to parse- Returns:
- true if successfully parsed
-
parse
public boolean parse(String in)
Parses the given string.- Parameters:
in
- the string to parse- Returns:
- true if successfully parsed
-
-