Resolver
Date: 2019-10-22

org.jmol.adapter.smarter

## Class Resolver

- java.lang.Object
- - org.jmol.adapter.smarter.Resolver

-     public class Resolver
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.String[]` | `abinitContainsRecords`
    `private static java.lang.String[]` | `adfContainsRecords`
    `private static java.lang.String[]` | `aflowContainsRecords`
    `private static java.lang.String[]` | `ampacContainsRecords`
    `private static java.lang.String[]` | `bilbaoContainsRecords`
    `private static java.lang.String[]` | `cfiStartRecords`
    `private static java.lang.String[]` | `cgdLineStartRecords`
    `private static java.lang.String[]` | `cif2StartRecords`
    `private static java.lang.String[]` | `cifLineStartRecords`
    `private static java.lang.String` | `classBase`
    `private static java.lang.String` | `CML_NAMESPACE_URI`
    `private static java.lang.String[]` | `crystalContainsRecords`
    `private static java.lang.String[]` | `csfLineStartRecords`
    `private static java.lang.String[]` | `cubeFileStartRecords`
    `private static java.lang.String[]` | `dcdFileStartRecords`
    `private static java.lang.String[]` | `dgridContainsRecords`
    `private static java.lang.String[]` | `dmolContainsRecords`
    `private static java.lang.String[]` | `espressoContainsRecords`
    `private static java.lang.String[][]` | `fileStartsWithRecords`
    `private static java.lang.String[]` | `gamessUKContainsRecords`
    `private static java.lang.String[]` | `gamessUSContainsRecords`
    `private static java.lang.String[]` | `gaussianContainsRecords`
    `private static java.lang.String[]` | `gaussianFchkContainsRecords`
    `private static java.lang.String[]` | `ghemicalMMLineStartRecords`
    `private static java.lang.String[]` | `gulpContainsRecords`
    `private static java.lang.String[][]` | `headerContainsRecords`
    `private static java.lang.String[]` | `hyperChemLineStartRecords`
    `private static java.lang.String[]` | `inputContainsRecords`
    `private static java.lang.String[]` | `inputFileStartRecords`
    `private static java.lang.String[]` | `jaguarLineStartRecords`
    `private static java.lang.String[]` | `janaStartRecords`
    `private static java.lang.String[]` | `jcampdxStartRecords`
    `private static java.lang.String[]` | `jmoldataStartRecords`
    `private static java.lang.String[]` | `jsonStartRecords`
    `private static int` | `LEADER_CHAR_MAX`
    `private static java.lang.String[][]` | `lineStartsWithRecords`
    `private static java.lang.String[]` | `m3dStartRecords`
    `private static java.lang.String[]` | `magCifContainsRecords`
    `private static java.lang.String[]` | `magresFileStartRecords`
    `private static java.lang.String[]` | `mdlLineStartRecords`
    `private static java.lang.String[]` | `mdTopLineStartRecords`
    `private static java.lang.String[]` | `mmcifLineStartRecords`
    `private static java.lang.String[]` | `mol2Records`
    `private static java.lang.String[]` | `moldenFileStartRecords`
    `private static java.lang.String[]` | `mopacArchiveContainsRecords`
    `private static java.lang.String[]` | `mopacContainsRecords`
    `private static int[]` | `n`
    `private static java.lang.String[]` | `nwchemContainsRecords`
    `private static java.lang.String[]` | `p2nStartRecords`
    `private static java.lang.String[]` | `pdbLineStartRecords`
    `private static java.lang.String[]` | `pqrStartRecords`
    `private static java.lang.String[]` | `psiContainsRecords`
    `private static java.lang.String[]` | `pymolStartRecords`
    `private static java.lang.String[]` | `qchemContainsRecords`
    `private static java.lang.String[]` | `qcJsonContainsRecords`
    `private static java.lang.String[]` | `readerSets`
    `private static java.lang.String[]` | `shelxLineStartRecords`
    `private static java.lang.String[]` | `siestaContainsRecords`
    `private static java.lang.String[]` | `spartanBinaryContainsRecords`
    `private static java.lang.String[]` | `spartanContainsRecords`
    `private static java.lang.String[]` | `spartanSmolLineStartRecords`
    `private static java.lang.String[]` | `sptRecords`
    `private static java.lang.String[]` | `tlsDataOnlyFileStartRecords`
    `private static java.lang.String[]` | `uicrcifContainsRecords`
    `private static java.lang.String[]` | `vaspOutcarLineStartRecords`
    `private static java.lang.String[]` | `webmoFileStartRecords`
    `private static java.lang.String[]` | `xcrysDenContainsRecords`
    `private static java.lang.String[]` | `xmlContainsRecords`
    `private static java.lang.String[]` | `xmlStartRecords`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Resolver()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private static boolean` | `checkAims(java.lang.String[] lines)`
    `private static boolean` | `checkAlchemy(java.lang.String line)`
    `private static java.lang.String` | `checkCastepVaspSiesta(java.lang.String[] lines)`
    `private static boolean` | `checkCrystal(java.lang.String[] lines)`
    `private static boolean` | `checkCube(java.lang.String[] lines)`
    `private static java.lang.String` | `checkFileStart(java.lang.String leader)`
    `private static boolean` | `checkFoldingXyz(java.lang.String[] lines)`
    `private static boolean` | `checkGenNBO(java.lang.String[] lines, java.lang.String leader)`
    `private static boolean` | `checkGromacs(java.lang.String[] lines)`
    `private static java.lang.String` | `checkHeaderContains(java.lang.String header)`
    `private static java.lang.String` | `checkLineStarts(java.lang.String[] lines)`
    `private static int` | `checkMol(java.lang.String[] lines)`
    `private static boolean` | `checkMopacGraphf(java.lang.String[] lines)`
    `private static boolean` | `checkOdyssey(java.lang.String[] lines)`
    `private static java.lang.String` | `checkSpecial1(int nLines, java.lang.String[] lines, java.lang.String leader)`
    `private static java.lang.String` | `checkSpecial2(java.lang.String[] lines)`
    `private static boolean` | `checkWien2k(java.lang.String[] lines)`
    `private static int` | `checkXyz(java.lang.String[] lines)`
    `private static java.lang.String` | `determineAtomSetCollectionReader(java.lang.Object readerOrDocument, boolean returnLines)` the main resolver method.
    `static java.lang.Object` | `DOMResolve(java.util.Map<java.lang.String,java.lang.Object> htParams)` a largely untested reader of the DOM - where in a browser there is model actually in XML format already present on the page.
    `(package private) static java.lang.Object` | `getAtomCollectionReader(java.lang.String fullName, java.lang.String type, java.lang.Object readerOrDocument, java.util.Map<java.lang.String,java.lang.Object> htParams, int ptFile)` the main method for reading files.
    `static java.lang.String` | `getBinaryType(java.io.InputStream inputStream)`
    `(package private) static java.lang.String` | `getFileType(java.io.BufferedReader br)` From SmarterJmolAdapter.getFileTypeName(Object ascOrReader) just return the file type with no exception issues
    `static java.lang.Object` | `getReader(java.lang.String readerName, java.util.Map<java.lang.String,java.lang.Object> htParams)` Get a reader based on its name.
    `static java.lang.String` | `getReaderClassBase(java.lang.String type)`
    `private static java.lang.String` | `getReaderFromType(java.lang.String type)`
    `private static java.lang.String` | `getXmlType(java.lang.String header)`
    `private static boolean` | `isFloat(java.lang.String s)`
    `private static boolean` | `isInt(java.lang.String s)`
    `private static java.lang.String` | `split(java.lang.String a, int n)`

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

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

- - ### Field Detail

    - #### classBase

          private static final java.lang.String classBase

      See Also:
        Constant Field Values

    - #### readerSets

          private static final java.lang.String[] readerSets

    - #### CML_NAMESPACE_URI

          private static final java.lang.String CML_NAMESPACE_URI

      See Also:
        Constant Field Values

    - #### LEADER_CHAR_MAX

          private static final int LEADER_CHAR_MAX

      See Also:
        Constant Field Values

    - #### sptRecords

          private static final java.lang.String[] sptRecords

    - #### m3dStartRecords

          private static final java.lang.String[] m3dStartRecords

    - #### cubeFileStartRecords

          private static final java.lang.String[] cubeFileStartRecords

    - #### mol2Records

          private static final java.lang.String[] mol2Records

    - #### webmoFileStartRecords

          private static final java.lang.String[] webmoFileStartRecords

    - #### moldenFileStartRecords

          private static final java.lang.String[] moldenFileStartRecords

    - #### dcdFileStartRecords

          private static final java.lang.String[] dcdFileStartRecords

    - #### tlsDataOnlyFileStartRecords

          private static final java.lang.String[] tlsDataOnlyFileStartRecords

    - #### inputFileStartRecords

          private static final java.lang.String[] inputFileStartRecords

    - #### magresFileStartRecords

          private static final java.lang.String[] magresFileStartRecords

    - #### pymolStartRecords

          private static final java.lang.String[] pymolStartRecords

    - #### janaStartRecords

          private static final java.lang.String[] janaStartRecords

    - #### jsonStartRecords

          private static final java.lang.String[] jsonStartRecords

    - #### jcampdxStartRecords

          private static final java.lang.String[] jcampdxStartRecords

    - #### jmoldataStartRecords

          private static final java.lang.String[] jmoldataStartRecords

    - #### pqrStartRecords

          private static final java.lang.String[] pqrStartRecords

    - #### p2nStartRecords

          private static final java.lang.String[] p2nStartRecords

    - #### cif2StartRecords

          private static final java.lang.String[] cif2StartRecords

    - #### xmlStartRecords

          private static final java.lang.String[] xmlStartRecords

    - #### cfiStartRecords

          private static final java.lang.String[] cfiStartRecords

    - #### fileStartsWithRecords

          private static final java.lang.String[][] fileStartsWithRecords

    - #### n

          private static int[] n

    - #### mmcifLineStartRecords

          private static final java.lang.String[] mmcifLineStartRecords

    - #### cifLineStartRecords

          private static final java.lang.String[] cifLineStartRecords

    - #### pdbLineStartRecords

          private static final java.lang.String[] pdbLineStartRecords

    - #### cgdLineStartRecords

          private static final java.lang.String[] cgdLineStartRecords

    - #### shelxLineStartRecords

          private static final java.lang.String[] shelxLineStartRecords

    - #### ghemicalMMLineStartRecords

          private static final java.lang.String[] ghemicalMMLineStartRecords

    - #### jaguarLineStartRecords

          private static final java.lang.String[] jaguarLineStartRecords

    - #### mdlLineStartRecords

          private static final java.lang.String[] mdlLineStartRecords

    - #### spartanSmolLineStartRecords

          private static final java.lang.String[] spartanSmolLineStartRecords

    - #### csfLineStartRecords

          private static final java.lang.String[] csfLineStartRecords

    - #### mdTopLineStartRecords

          private static final java.lang.String[] mdTopLineStartRecords

    - #### hyperChemLineStartRecords

          private static final java.lang.String[] hyperChemLineStartRecords

    - #### vaspOutcarLineStartRecords

          private static final java.lang.String[] vaspOutcarLineStartRecords

    - #### lineStartsWithRecords

          private static final java.lang.String[][] lineStartsWithRecords

    - #### bilbaoContainsRecords

          private static final java.lang.String[] bilbaoContainsRecords

    - #### xmlContainsRecords

          private static final java.lang.String[] xmlContainsRecords

    - #### gaussianContainsRecords

          private static final java.lang.String[] gaussianContainsRecords

    - #### ampacContainsRecords

          private static final java.lang.String[] ampacContainsRecords

    - #### mopacContainsRecords

          private static final java.lang.String[] mopacContainsRecords

    - #### qchemContainsRecords

          private static final java.lang.String[] qchemContainsRecords

    - #### gamessUKContainsRecords

          private static final java.lang.String[] gamessUKContainsRecords

    - #### gamessUSContainsRecords

          private static final java.lang.String[] gamessUSContainsRecords

    - #### spartanBinaryContainsRecords

          private static final java.lang.String[] spartanBinaryContainsRecords

    - #### spartanContainsRecords

          private static final java.lang.String[] spartanContainsRecords

    - #### adfContainsRecords

          private static final java.lang.String[] adfContainsRecords

    - #### psiContainsRecords

          private static final java.lang.String[] psiContainsRecords

    - #### nwchemContainsRecords

          private static final java.lang.String[] nwchemContainsRecords

    - #### uicrcifContainsRecords

          private static final java.lang.String[] uicrcifContainsRecords

    - #### dgridContainsRecords

          private static final java.lang.String[] dgridContainsRecords

    - #### crystalContainsRecords

          private static final java.lang.String[] crystalContainsRecords

    - #### dmolContainsRecords

          private static final java.lang.String[] dmolContainsRecords

    - #### gulpContainsRecords

          private static final java.lang.String[] gulpContainsRecords

    - #### espressoContainsRecords

          private static final java.lang.String[] espressoContainsRecords

    - #### siestaContainsRecords

          private static final java.lang.String[] siestaContainsRecords

    - #### xcrysDenContainsRecords

          private static final java.lang.String[] xcrysDenContainsRecords

    - #### mopacArchiveContainsRecords

          private static final java.lang.String[] mopacArchiveContainsRecords

    - #### abinitContainsRecords

          private static final java.lang.String[] abinitContainsRecords

    - #### qcJsonContainsRecords

          private static final java.lang.String[] qcJsonContainsRecords

    - #### gaussianFchkContainsRecords

          private static final java.lang.String[] gaussianFchkContainsRecords

    - #### inputContainsRecords

          private static final java.lang.String[] inputContainsRecords

    - #### aflowContainsRecords

          private static final java.lang.String[] aflowContainsRecords

    - #### magCifContainsRecords

          private static final java.lang.String[] magCifContainsRecords

    - #### headerContainsRecords

          private static final java.lang.String[][] headerContainsRecords

  - ### Constructor Detail

    - #### Resolver

          public Resolver()

  - ### Method Detail

    - #### getReaderClassBase

          public static final java.lang.String getReaderClassBase(java.lang.String type)

    - #### getFileType

          static java.lang.String getFileType(java.io.BufferedReader br)

      From SmarterJmolAdapter.getFileTypeName(Object ascOrReader) just return the file type with no exception issues
      Parameters:
        `br` -
      Returns:
        String file type

    - #### getAtomCollectionReader

          static java.lang.Object getAtomCollectionReader(java.lang.String fullName,
                                                          java.lang.String type,
                                                          java.lang.Object readerOrDocument,
                                                          java.util.Map<java.lang.String,java.lang.Object> htParams,
                                                          int ptFile)
                                                   throws java.lang.Exception

      the main method for reading files. Called from SmarterJmolAdapter when reading a file, reading a set of files, or reading a ZIP file
      Parameters:
        `fullName` -
        `type` -
        `readerOrDocument` -
        `htParams` -
        `ptFile` -
      Returns:
        an AtomSetCollection or a String error
      Throws:
        `java.lang.Exception`

    - #### getReader

          public static java.lang.Object getReader(java.lang.String readerName,
                                                   java.util.Map<java.lang.String,java.lang.Object> htParams)

      Get a reader based on its name.
      Parameters:
        `readerName` -
        `htParams` -
      Returns:
        AtomSetCollectionReader or error message

    - #### getReaderFromType

          private static final java.lang.String getReaderFromType(java.lang.String type)

    - #### split

          private static java.lang.String split(java.lang.String a,
                                                int n)

    - #### DOMResolve

          public static java.lang.Object DOMResolve(java.util.Map<java.lang.String,java.lang.Object> htParams)
                                             throws java.lang.Exception

      a largely untested reader of the DOM - where in a browser there is model actually in XML format already present on the page. -- Egon Willighagen
      Parameters:
        `htParams` -
      Returns:
        an AtomSetCollection or a String error
      Throws:
        `java.lang.Exception`

    - #### determineAtomSetCollectionReader

          private static java.lang.String determineAtomSetCollectionReader(java.lang.Object readerOrDocument,
                                                                           boolean returnLines)
                                                                    throws java.lang.Exception

      the main resolver method. One of the great advantages of Jmol is that it can smartly determine a file type from its contents. In cases where this is not possible, one can force a file type using a prefix to a filename. For example: load mol2::xxxx.whatever This is only necessary for a few file types, where only numbers are involved -- molecular dynamics coordinate files, for instance (mdcrd).
      Parameters:
        `readerOrDocument` -
        `returnLines` -
      Returns:
        readerName or a few lines, if requested, or null
      Throws:
        `java.lang.Exception`

    - #### getBinaryType

          public static java.lang.String getBinaryType(java.io.InputStream inputStream)

    - #### checkFileStart

          private static java.lang.String checkFileStart(java.lang.String leader)

    - #### checkSpecial1

          private static final java.lang.String checkSpecial1(int nLines,
                                                              java.lang.String[] lines,
                                                              java.lang.String leader)

    - #### checkAims

          private static boolean checkAims(java.lang.String[] lines)

    - #### checkAlchemy

          private static boolean checkAlchemy(java.lang.String line)

    - #### isInt

          private static boolean isInt(java.lang.String s)

    - #### isFloat

          private static boolean isFloat(java.lang.String s)

    - #### checkCube

          private static boolean checkCube(java.lang.String[] lines)

    - #### checkFoldingXyz

          private static boolean checkFoldingXyz(java.lang.String[] lines)

      Parameters:
        `lines` - First lines of the files.
      Returns:
        Indicates if the file may be a Folding@Home file.

    - #### checkGenNBO

          private static boolean checkGenNBO(java.lang.String[] lines,
                                             java.lang.String leader)

    - #### checkMol

          private static int checkMol(java.lang.String[] lines)

    - #### checkMopacGraphf

          private static boolean checkMopacGraphf(java.lang.String[] lines)

      Parameters:
        `lines` - First lines of the files.
      Returns:
        Indicates if the file is a Mopac GRAPHF output file.

    - #### checkOdyssey

          private static boolean checkOdyssey(java.lang.String[] lines)

    - #### checkWien2k

          private static boolean checkWien2k(java.lang.String[] lines)

    - #### checkXyz

          private static int checkXyz(java.lang.String[] lines)

    - #### checkLineStarts

          private static java.lang.String checkLineStarts(java.lang.String[] lines)

    - #### checkHeaderContains

          private static java.lang.String checkHeaderContains(java.lang.String header)
                                                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getXmlType

          private static java.lang.String getXmlType(java.lang.String header)
                                              throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkSpecial2

          private static final java.lang.String checkSpecial2(java.lang.String[] lines)

    - #### checkCrystal

          private static boolean checkCrystal(java.lang.String[] lines)

    - #### checkGromacs

          private static boolean checkGromacs(java.lang.String[] lines)

    - #### checkCastepVaspSiesta

          private static java.lang.String checkCastepVaspSiesta(java.lang.String[] lines)