# Class JDXReader

java.lang.Object
jspecview.source.JDXReader

All Implemented Interfaces:
  `JmolJDXMOLReader`

public class JDXReader extends Object implements 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 Type
Method
Description
`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 method
`static JDXSource`
`createJDXSourceFromStream(InputStream in, boolean obscure, boolean loadImaginary, float nmrMaxY)`
used only for preferences display and Android
`String`
`discardLinesUntilContains(String containsMatch)`
`String`
`discardLinesUntilContains2(String s1, String s2)`
`String`
`discardLinesUntilNonBlank()`
`static Map<String,String>`
`getHeaderMap(InputStream in, Map<String,String> map)`
`static Map<String,String>`
`getHeaderMapS(InputStream in, Map<String,String> map, int index, String suffix)`
`static String`
`getVarList(String dataClass)`
`static void`
`main(String[] args)`
`void`
`processModelData(String id, String data, String type, String base, String last, float modelScale, float vibScale, boolean isFirst)`
`String`
`rd()`
`void`
`setSpectrumPeaks(int nH, String peakXLabel, String peakYlabel)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getVarList

public static String getVarList(String dataClass)

### 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 null
  `index` - >= 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

public String rd() throws Exception

Specified by:
  `rd` in interface `JmolJDXMOLReader`
Throws:
  `Exception`

### setSpectrumPeaks

public void setSpectrumPeaks(int nH, String peakXLabel, String peakYlabel)

Specified by:
  `setSpectrumPeaks` in interface `JmolJDXMOLReader`

### addPeakData

public void addPeakData(String info)

Specified by:
  `addPeakData` in interface `JmolJDXMOLReader`

### 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 interface `JmolJDXMOLReader`
Throws:
  `Exception`

### discardLinesUntilContains

public String discardLinesUntilContains(String containsMatch) throws Exception

Specified by:
  `discardLinesUntilContains` in interface `JmolJDXMOLReader`
Throws:
  `Exception`

### discardLinesUntilContains2

public String discardLinesUntilContains2(String s1, String s2) throws Exception

Specified by:
  `discardLinesUntilContains2` in interface `JmolJDXMOLReader`
Throws:
  `Exception`

### discardLinesUntilNonBlank

public String discardLinesUntilNonBlank() throws Exception

Specified by:
  `discardLinesUntilNonBlank` in interface `JmolJDXMOLReader`
Throws:
  `Exception`

### main

public static void main(String[] args)