Package jspecview.source
Class JDXReader
java.lang.Object
jspecview.source.JDXReader
- All Implemented Interfaces:
JmolJDXMOLReader
JDXFileReader
reads JDX data, including complex BLOCK files that
contain NTUPLE blocks or nested BLOCK data.
In addition, this reader allows for simple concatenation -- no LINK record is
required. This allows for testing simply by joining files.
We also might be able to adapt this to reading a ZIP file collection.- Author:
- Debbie-Ann Facey, Khari A. Bryan, Prof. Robert J. Lancashire, Bob Hanson, hansonr@stolaf.edu
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
addPeakData
(String info) static JDXSource
createJDXSource
(GenericFileInterface file, Object in, String filePath, boolean obscure, boolean loadImaginary, int iSpecFirst, int iSpecLast, float nmrMaxY) general entrance methodstatic JDXSource
createJDXSourceFromStream
(InputStream in, boolean obscure, boolean loadImaginary, float nmrMaxY) used only for preferences display and AndroiddiscardLinesUntilContains
(String containsMatch) discardLinesUntilContains2
(String s1, String s2) getHeaderMap
(InputStream in, Map<String, String> map) getHeaderMapS
(InputStream in, Map<String, String> map, String suffix) static String
getVarList
(String dataClass) void
processModelData
(String id, String data, String type, String base, String last, float modelScale, float vibScale, boolean isFirst) rd()
void
setSpectrumPeaks
(int nH, String peakXLabel, String peakYlabel)
-
Method Details
-
getVarList
-
createJDXSourceFromStream
public static JDXSource createJDXSourceFromStream(InputStream in, boolean obscure, boolean loadImaginary, float nmrMaxY) throws Exception used only for preferences display and Android- Parameters:
in
-obscure
-loadImaginary
-nmrMaxY
-- Returns:
- source
- Throws:
Exception
-
getHeaderMap
public static Map<String,String> getHeaderMap(InputStream in, Map<String, String> map) throws Exception- Throws:
Exception
-
getHeaderMapS
public static Map<String,String> getHeaderMapS(InputStream in, Map<String, String> map, String suffix) throws Exception- Throws:
Exception
-
createJDXSource
public static JDXSource createJDXSource(GenericFileInterface file, Object in, String filePath, boolean obscure, boolean loadImaginary, int iSpecFirst, int iSpecLast, float nmrMaxY) throws Exception general entrance method- Parameters:
file
-in
- one of: BufferedReader, InputStream, String, byte[]filePath
-obscure
-loadImaginary
-iSpecFirst
-iSpecLast
-nmrMaxY
-- Returns:
- source
- Throws:
Exception
-
addHeader
-
rd
- Specified by:
rd
in interfaceJmolJDXMOLReader
- Throws:
Exception
-
setSpectrumPeaks
- Specified by:
setSpectrumPeaks
in interfaceJmolJDXMOLReader
-
addPeakData
- Specified by:
addPeakData
in interfaceJmolJDXMOLReader
-
processModelData
public void processModelData(String id, String data, String type, String base, String last, float modelScale, float vibScale, boolean isFirst) throws Exception - Specified by:
processModelData
in interfaceJmolJDXMOLReader
- Throws:
Exception
-
discardLinesUntilContains
- Specified by:
discardLinesUntilContains
in interfaceJmolJDXMOLReader
- Throws:
Exception
-
discardLinesUntilContains2
- Specified by:
discardLinesUntilContains2
in interfaceJmolJDXMOLReader
- Throws:
Exception
-
discardLinesUntilNonBlank
- Specified by:
discardLinesUntilNonBlank
in interfaceJmolJDXMOLReader
- Throws:
Exception
-