Class XmlCmlReader

All Implemented Interfaces:
javajs.api.GenericLineReader
Direct Known Subclasses:
XmlMOReader

public class XmlCmlReader extends XmlReader
A CML2 Reader - If passed a bufferedReader (from a file or inline string), we generate a SAX parser and use callbacks to construct an AtomSetCollection. If passed a JSObject (from LiveConnect) we treat it as a JS DOM tree, and walk the tree, (using the same processing as the SAX parser) to construct the AtomSetCollection. symmetry added by Bob Hanson: setSpaceGroupName() setUnitCellItem() setFractionalCoordinates() setAtomCoord() applySymmetryAndSetTrajectory() "isotope" added 4/6/2009 Bob Hanson
  • Field Details

    • scalarDictRef

      private String scalarDictRef
    • scalarDictValue

      private String scalarDictValue
    • scalarTitle

      private String scalarTitle
    • cellParameterType

      private String cellParameterType
    • checkedSerial

      private boolean checkedSerial
    • isSerial

      private boolean isSerial
    • moleculeNesting

      private int moleculeNesting
    • latticeVectorPtr

      private int latticeVectorPtr
    • embeddedCrystal

      private boolean embeddedCrystal
    • atomIdNames

      private Properties atomIdNames
    • tokens

      protected String[] tokens
    • aaLen

      private int aaLen
    • atomArray

      private Atom[] atomArray
    • bondCount

      private int bondCount
    • bondArray

      private Bond[] bondArray
    • tokenCount

      private int tokenCount
    • moduleNestingLevel

      private int moduleNestingLevel
    • haveMolecule

      private boolean haveMolecule
    • localSpaceGroupName

      private String localSpaceGroupName
    • processing

      protected boolean processing
    • state

      protected int state
    • atomIndex0

      private int atomIndex0
    • joinList

      private javajs.util.Lst<String[]> joinList
    • mapRtoA

      private Map<Atom,String> mapRtoA
    • deleteAtoms

      private javajs.util.BS deleteAtoms
    • moleculeID

      protected String moleculeID
    • htModelAtomMap

      protected Map<String,Object> htModelAtomMap
    • optimize2d

      private boolean optimize2d
    • START

      protected static final int START
      state constants
      See Also:
    • CML

      protected static final int CML
      state constants
      See Also:
    • CRYSTAL

      protected static final int CRYSTAL
      state constants
      See Also:
    • CRYSTAL_SCALAR

      protected static final int CRYSTAL_SCALAR
      state constants
      See Also:
    • CRYSTAL_SYMMETRY

      protected static final int CRYSTAL_SYMMETRY
      state constants
      See Also:
    • CRYSTAL_SYMMETRY_TRANSFORM3

      protected static final int CRYSTAL_SYMMETRY_TRANSFORM3
      state constants
      See Also:
    • MOLECULE

      protected static final int MOLECULE
      state constants
      See Also:
    • MOLECULE_ATOM_ARRAY

      protected static final int MOLECULE_ATOM_ARRAY
      state constants
      See Also:
    • MOLECULE_ATOM

      protected static final int MOLECULE_ATOM
      state constants
      See Also:
    • MOLECULE_ATOM_SCALAR

      protected static final int MOLECULE_ATOM_SCALAR
      state constants
      See Also:
    • MOLECULE_BOND_ARRAY

      protected static final int MOLECULE_BOND_ARRAY
      state constants
      See Also:
    • MOLECULE_BOND

      protected static final int MOLECULE_BOND
      state constants
      See Also:
    • MOLECULE_BOND_STEREO

      protected static final int MOLECULE_BOND_STEREO
      state constants
      See Also:
    • MOLECULE_FORMULA

      protected static final int MOLECULE_FORMULA
      state constants
      See Also:
    • MOLECULE_ATOM_BUILTIN

      protected static final int MOLECULE_ATOM_BUILTIN
      state constants
      See Also:
    • MOLECULE_BOND_BUILTIN

      protected static final int MOLECULE_BOND_BUILTIN
      state constants
      See Also:
    • MODULE

      protected static final int MODULE
      state constants
      See Also:
    • SYMMETRY

      protected static final int SYMMETRY
      state constants
      See Also:
    • LATTICE_VECTOR

      protected static final int LATTICE_VECTOR
      state constants
      See Also:
    • ASSOCIATION

      protected static final int ASSOCIATION
      state constants
      See Also:
    • unitCellParamTags

      private static final String[] unitCellParamTags
  • Constructor Details

    • XmlCmlReader

      public XmlCmlReader()
  • Method Details

    • processXml

      protected void processXml(XmlReader parent, Object saxReader) throws Exception
      the current state
      Overrides:
      processXml in class XmlReader
      Throws:
      Exception
    • processStartElement

      public void processStartElement(String name, String nodeName)
      Overrides:
      processStartElement in class XmlReader
      nodeName - TODO
    • processStart2

      protected void processStart2(String name)
    • getAtomIndex

      private int getAtomIndex(String label)
    • processEndElement

      void processEndElement(String name)
      Overrides:
      processEndElement in class XmlReader
    • processEnd2

      public void processEnd2(String name)
    • addBond

      private void addBond(Bond bond)
    • checkBondToR

      private boolean checkBondToR(String a1name, String a2name)
      Checks to see if we have a bond to R and, if so, adds this R atom as a key to its attached atom
      Parameters:
      a1name -
      a2name -
      Returns:
      true if handled so no need to add a bond
    • setAtomNames

      private void setAtomNames()
    • addNewBond

      private void addNewBond(String a1, String a2, int order)
    • fixSerialName

      private String fixSerialName(String a)
    • getDictRefValue

      private void getDictRefValue()
    • checkUnitCellItem

      private void checkUnitCellItem(String[] tags, String value)
    • addAtom

      private void addAtom(Atom atom)
    • parseBondToken

      private int parseBondToken(String str)
    • breakOutTokens

      private void breakOutTokens(String str)
    • breakOutAtomTokens

      void breakOutAtomTokens(String str)
    • checkAtomArrayLength

      void checkAtomArrayLength(int newAtomCount)
    • breakOutBondTokens

      void breakOutBondTokens(String str)
    • checkBondArrayLength

      void checkBondArrayLength(int newBondCount)
    • createNewAtomSet

      private void createNewAtomSet()
    • applySymmetryAndSetTrajectory

      public void applySymmetryAndSetTrajectory()
      Overrides:
      applySymmetryAndSetTrajectory in class XmlReader
    • endDocument

      public void endDocument()
      Overrides:
      endDocument in class XmlReader