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 TypeMethodDescriptionvoidaddPeakData(String info) static JDXSourcecreateJDXSource(GenericFileInterface file, Object in, String filePath, boolean obscure, boolean loadImaginary, int iSpecFirst, int iSpecLast, float nmrMaxY) general entrance methodstatic JDXSourcecreateJDXSourceFromStream(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, int index, String suffix) static StringgetVarList(String dataClass) static voidvoidprocessModelData(String id, String data, String type, String base, String last, float modelScale, float vibScale, boolean isFirst) rd()voidsetSpectrumPeaks(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, int index, String suffix) throws Exception- Parameters:
in-map- may be nullindex- >= 0 for nth block; -1 for "last block"suffix-- Returns:
- map
- 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
-
rd
- Specified by:
rdin interfaceJmolJDXMOLReader- Throws:
Exception
-
setSpectrumPeaks
- Specified by:
setSpectrumPeaksin interfaceJmolJDXMOLReader
-
addPeakData
- Specified by:
addPeakDatain 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:
processModelDatain interfaceJmolJDXMOLReader- Throws:
Exception
-
discardLinesUntilContains
- Specified by:
discardLinesUntilContainsin interfaceJmolJDXMOLReader- Throws:
Exception
-
discardLinesUntilContains2
- Specified by:
discardLinesUntilContains2in interfaceJmolJDXMOLReader- Throws:
Exception
-
discardLinesUntilNonBlank
- Specified by:
discardLinesUntilNonBlankin interfaceJmolJDXMOLReader- Throws:
Exception
-
main
-