JDXMOLParser
Date: 2019-10-22

org.jmol.jsv

## Class JDXMOLParser

- java.lang.Object
- - org.jmol.jsv.JDXMOLParser

- All Implemented Interfaces:
    JmolJDXMOLParser

      public class JDXMOLParser
      extends java.lang.Object
      implements JmolJDXMOLParser

  Parses JDX-MOL records ##$MODELS and ##$PEAKS/##$SIGNALS. Used in both Jmol and JSpecView. Also gets info from ACD Labs files JCAMP-DX=5.00 $$ ACD/SpecManager v 12.01

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.lang.String` | `baseModel`
    `private java.lang.String` | `lastModel`
    `private java.lang.String` | `line`
    `private JmolJDXMOLReader` | `loader`
    `private java.lang.String` | `modelIdList`
    `private java.lang.String` | `peakFilePath`
    `private int[]` | `peakIndex`
    `private java.lang.String` | `piUnitsX`
    `private java.lang.String` | `piUnitsY`
    `private java.lang.String` | `thisModelID`
    `private float` | `vibScale`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JDXMOLParser()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private boolean` | `findRecord(java.lang.String tag)`
    `private java.lang.String` | `fixACDAtomList(java.lang.String atoms, java.util.Map<java.lang.String,java.lang.String> zzcMap, int nAtoms)`
    `private float` | `getACDPeakWidth(java.lang.String type)`
    `java.lang.String` | `getAttribute(java.lang.String line, java.lang.String tag)`
    `private void` | `getModelData(boolean isFirst)`
    `java.lang.String` | `getRecord(java.lang.String key)`
    `private void` | `getStringInfo(java.lang.String file, java.lang.String title, java.lang.String mytype, java.lang.String model, java.lang.String atoms, java.util.Map<java.lang.String,java.lang.Object[]> htSets, java.lang.String key, javajs.util.Lst<java.lang.Object[]> list, java.lang.String more)`
    `javajs.util.Lst<java.lang.String[]>` | `readACDAssignments(int nPoints, boolean isPeakAssignment)`
    `java.lang.String` | `readACDMolFile()` MOL file embedded in JDX file
    `private java.lang.String` | `readLine()`
    `boolean` | `readModels()`
    `int` | `readPeaks(boolean isSignals, int peakCount)`
    `JmolJDXMOLParser` | `set(JmolJDXMOLReader loader, java.lang.String filePath, java.util.Map<java.lang.String,java.lang.Object> htParams)`
    `int` | `setACDAssignments(java.lang.String model, java.lang.String mytype, int peakCount, javajs.util.Lst<java.lang.String[]> acdlist, java.lang.String molFile)`
    `void` | `setLine(java.lang.String s)`
    `private int` | `setPeakData(javajs.util.Lst<java.lang.Object[]> list, int offset)`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### line

          private java.lang.String line

    - #### lastModel

          private java.lang.String lastModel

    - #### thisModelID

          private java.lang.String thisModelID

    - #### baseModel

          private java.lang.String baseModel

    - #### vibScale

          private float vibScale

    - #### piUnitsX

          private java.lang.String piUnitsX

    - #### piUnitsY

          private java.lang.String piUnitsY

    - #### loader

          private JmolJDXMOLReader loader

    - #### modelIdList

          private java.lang.String modelIdList

    - #### peakIndex

          private int[] peakIndex

    - #### peakFilePath

          private java.lang.String peakFilePath

  - ### Constructor Detail

    - #### JDXMOLParser

          public JDXMOLParser()

  - ### Method Detail

    - #### set

          public JmolJDXMOLParser set(JmolJDXMOLReader loader,
                                      java.lang.String filePath,
                                      java.util.Map<java.lang.String,java.lang.Object> htParams)

      Specified by:
        `set` in interface `JmolJDXMOLParser`

    - #### getAttribute

          public java.lang.String getAttribute(java.lang.String line,
                                               java.lang.String tag)

      Specified by:
        `getAttribute` in interface `JmolJDXMOLParser`

    - #### getRecord

          public java.lang.String getRecord(java.lang.String key)
                                     throws java.lang.Exception

      Specified by:
        `getRecord` in interface `JmolJDXMOLParser`
      Throws:
        `java.lang.Exception`

    - #### readModels

          public boolean readModels()
                             throws java.lang.Exception

      Specified by:
        `readModels` in interface `JmolJDXMOLParser`
      Throws:
        `java.lang.Exception`

    - #### readACDMolFile

          public java.lang.String readACDMolFile()
                                          throws java.lang.Exception

      MOL file embedded in JDX file
      Specified by:
        `readACDMolFile` in interface `JmolJDXMOLParser`
      Throws:
        `java.lang.Exception`

    - #### readACDAssignments

          public javajs.util.Lst<java.lang.String[]> readACDAssignments(int nPoints,
                                                                        boolean isPeakAssignment)
                                                                 throws java.lang.Exception

      Specified by:
        `readACDAssignments` in interface `JmolJDXMOLParser`
      Throws:
        `java.lang.Exception`

    - #### setACDAssignments

          public int setACDAssignments(java.lang.String model,
                                       java.lang.String mytype,
                                       int peakCount,
                                       javajs.util.Lst<java.lang.String[]> acdlist,
                                       java.lang.String molFile)
                                throws java.lang.Exception

      Specified by:
        `setACDAssignments` in interface `JmolJDXMOLParser`
      Throws:
        `java.lang.Exception`

    - #### fixACDAtomList

          private java.lang.String fixACDAtomList(java.lang.String atoms,
                                                  java.util.Map<java.lang.String,java.lang.String> zzcMap,
                                                  int nAtoms)

    - #### getACDPeakWidth

          private float getACDPeakWidth(java.lang.String type)

    - #### readPeaks

          public int readPeaks(boolean isSignals,
                               int peakCount)
                        throws java.lang.Exception

      Specified by:
        `readPeaks` in interface `JmolJDXMOLParser`
      Throws:
        `java.lang.Exception`

    - #### setPeakData

          private int setPeakData(javajs.util.Lst<java.lang.Object[]> list,
                                  int offset)

    - #### getStringInfo

          private void getStringInfo(java.lang.String file,
                                     java.lang.String title,
                                     java.lang.String mytype,
                                     java.lang.String model,
                                     java.lang.String atoms,
                                     java.util.Map<java.lang.String,java.lang.Object[]> htSets,
                                     java.lang.String key,
                                     javajs.util.Lst<java.lang.Object[]> list,
                                     java.lang.String more)

    - #### getModelData

          private void getModelData(boolean isFirst)
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### findRecord

          private boolean findRecord(java.lang.String tag)
                              throws java.lang.Exception

      Parameters:
        `tag` -
      Returns:
        line
      Throws:
        `java.lang.Exception`

    - #### readLine

          private java.lang.String readLine()
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### setLine

          public void setLine(java.lang.String s)

      Specified by:
        `setLine` in interface `JmolJDXMOLParser`