AtomSetCollection
Date: 2019-10-22

org.jmol.adapter.smarter

## Class AtomSetCollection

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

-     public class AtomSetCollection
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `ac`
    `boolean` | `allowMultiple`
    `Atom[]` | `atoms`
    `private int[]` | `atomSetAtomCounts`
    `private int[]` | `atomSetAtomIndexes`
    `private java.util.Map<java.lang.String,java.lang.Object>[]` | `atomSetAuxiliaryInfo`
    `private int[]` | `atomSetBondCounts`
    `int` | `atomSetCount`
    `java.util.Map<java.lang.String,java.lang.Object>` | `atomSetInfo`
    `private int[]` | `atomSetNumbers`
    `java.util.Map<java.lang.String,Atom>` | `atomSymbolicMap`
    `int` | `baseSymmetryAtomCount`
    `int` | `bondCount`
    `(package private) int` | `bondIndex0`
    `Bond[]` | `bonds`
    `javajs.util.BS` | `bsAtoms`
    `javajs.util.BS` | `bsStructuredModels`
    `boolean` | `checkLatticeOnly`
    `boolean` | `checkSpecial`
    `(package private) java.lang.String` | `collectionName`
    `boolean` | `coordinatesAreFractional`
    `boolean` | `doFixPeriodic`
    `java.lang.String` | `errorMessage`
    `java.lang.String` | `fileTypeName`
    `static int` | `GLOBAL_CONECT`
    `static int` | `GLOBAL_DOMAINS`
    `static int` | `GLOBAL_FRACTCOORD`
    `static int` | `GLOBAL_ISPDB`
    `static int` | `GLOBAL_SYMMETRY`
    `static int` | `GLOBAL_UNITCELLS`
    `static int` | `GLOBAL_VALIDATIONS`
    `private static java.lang.String[]` | `globalBooleans`
    `boolean` | `haveAnisou`
    `boolean` | `haveUnitCell`
    `int` | `iSet`
    `(package private) boolean` | `isTrajectory`
    `(package private) AtomSetCollectionReader` | `reader`
    `private javajs.util.Lst<AtomSetCollectionReader>` | `readerList`
    `int` | `structureCount`
    `Structure[]` | `structures`
    `private javajs.util.Lst<java.lang.String>` | `trajectoryNames`
    `private int` | `trajectoryStepCount`
    `private javajs.util.Lst<javajs.util.P3[]>` | `trajectorySteps`
    `private javajs.util.Lst<javajs.util.V3[]>` | `vibrationSteps`
    `int` | `vibScale`
    `XtalSymmetry` | `xtalSymmetry`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AtomSetCollection(java.lang.String fileTypeName, AtomSetCollectionReader reader, AtomSetCollection[] array, javajs.util.Lst<?> list)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Atom` | `addAtom(Atom atom)`
    `void` | `addAtomWithMappedName(Atom atom)`
    `void` | `addAtomWithMappedSerialNumber(Atom atom)`
    `void` | `addBond(Bond bond)`
    `Atom` | `addNewAtom()`
    `void` | `addNewBondFromNames(java.lang.String atomName1, java.lang.String atomName2, int order)`
    `void` | `addNewBondWithOrder(int atomIndex1, int atomIndex2, int order)`
    `void` | `addNewBondWithOrderA(Atom atom1, Atom atom2, int order)`
    `void` | `addStructure(Structure structure)`
    `javajs.util.V3` | `addVibrationVector(int iatom, float x, float y, float z)`
    `void` | `addVibrationVectorWithSymmetry(int iatom, float vx, float vy, float vz, boolean withSymmetry)`
    `void` | `appendAtomSetCollection(int collectionIndex, AtomSetCollection collection)` Appends an AtomSetCollection
    `private void` | `appendAtomSetCollectionList(javajs.util.Lst<?> list)`
    `void` | `centralize()`
    `void` | `checkNoEmptyModel()`
    `void` | `clearGlobalBoolean(int globalIndex)`
    `void` | `cloneAtomSetWithBonds(boolean isLast)`
    `int` | `cloneFirstAtomSet(int atomCount)`
    `int` | `cloneLastAtomSet()`
    `int` | `cloneLastAtomSetFromPoints(int ac, javajs.util.P3[] pts)`
    `void` | `discardPreviousAtoms()`
    `void` | `finalizeStructures()`
    `private void` | `finalizeTrajectory()`
    `void` | `finalizeTrajectoryAs(javajs.util.Lst<javajs.util.P3[]> trajectorySteps, javajs.util.Lst<javajs.util.V3[]> vibrationSteps)`
    `(package private) void` | `finish()`
    `private static javajs.util.P3` | `fixPeriodic(javajs.util.P3 pt, javajs.util.P3 pt0)`
    `private static float` | `fixPoint(float x, float x0)`
    `(package private) void` | `freeze(boolean reverseModels)`
    `Atom` | `getAtomFromName(java.lang.String atomName)`
    `int` | `getAtomIndex(java.lang.String name)`
    `int` | `getAtomSetAtomCount(int i)`
    `int` | `getAtomSetAtomIndex(int i)`
    `java.util.Map<java.lang.String,java.lang.Object>` | `getAtomSetAuxiliaryInfo(int atomSetIndex)`
    `java.lang.Object` | `getAtomSetAuxiliaryInfoValue(int index, java.lang.String key)`
    `int` | `getAtomSetBondCount(int i)`
    `(package private) java.lang.String` | `getAtomSetName(int atomSetIndex)`
    `(package private) int` | `getAtomSetNumber(int atomSetIndex)`
    `java.lang.String[][]` | `getBondList()`
    `(package private) boolean` | `getGlobalBoolean(int globalIndex)`
    `int` | `getHydrogenAtomCount()`
    `int` | `getLastAtomSetAtomCount()`
    `int` | `getLastAtomSetAtomIndex()`
    `private void` | `getList(boolean isAltLoc)`
    `SymmetryInterface` | `getSymmetry()`
    `XtalSymmetry` | `getXSymmetry()`
    `void` | `mapPartialCharge(java.lang.String atomName, float charge)`
    `(package private) void` | `mergeTrajectories(AtomSetCollection a)`
    `void` | `newAtomSet()` Create a new atoms set, clearing the atom map
    `void` | `newAtomSetClear(boolean doClearMap)` Create a new atom set, optionally clearing the atom map.
    `Atom` | `newCloneAtom(Atom atom)`
    `void` | `removeAtomSet(int imodel)` note that sets must be iterated from LAST to FIRST not a general method -- would mess up if we had unit cells
    `void` | `removeCurrentAtomSet()`
    `void` | `removeLastUnselectedAtoms()`
    `private void` | `reverseArray(int[] a)`
    `private void` | `reverseAtomSets()`
    `private static void` | `reverseList(javajs.util.Lst<?> list)`
    `private void` | `reverseObject(java.lang.Object[] o)`
    `private void` | `reverseSets(AtomSetObject[] o, int n)`
    `void` | `setAnisoBorU(Atom atom, float[] data, int type)`
    `void` | `setAtomProperties(java.lang.String key, java.lang.Object data, int atomSetIndex, boolean isGroup)`
    `boolean` | `setAtomSetCollectionPartialCharges(java.lang.String auxKey)` Sets the partial atomic charges based on asc auxiliary info
    `void` | `setAtomSetEnergy(java.lang.String energyString, float value)`
    `java.lang.String` | `setAtomSetFrequency(int mode, java.lang.String pathKey, java.lang.String label, java.lang.String freq, java.lang.String units)`
    `void` | `setAtomSetModelProperty(java.lang.String key, java.lang.String value)` Sets a property for the current AtomSet used specifically for creating directories and plots of frequencies and molecular energies
    `void` | `setAtomSetModelPropertyForSet(java.lang.String key, java.lang.String value, int atomSetIndex)` Sets the a property for the an AtomSet
    `void` | `setAtomSetName(java.lang.String atomSetName)` Sets the name for the current AtomSet
    `void` | `setAtomSetNumber(int index, int atomSetNumber)`
    `(package private) boolean` | `setAtomSetPartialCharges(java.lang.String auxKey)` Sets the partial atomic charges based on atomSet auxiliary info
    `void` | `setCollectionName(java.lang.String collectionName)`
    `void` | `setCoordinatesAreFractional(boolean tf)`
    `void` | `setCurrentAtomSetNumber(int atomSetNumber)` Sets the number for the current AtomSet
    `void` | `setCurrentModelInfo(java.lang.String key, java.lang.Object value)` Sets auxiliary information for the AtomSet
    `void` | `setGlobalBoolean(int globalIndex)`
    `void` | `setInfo(java.lang.String key, java.lang.Object value)`
    `void` | `setModelInfoForSet(java.lang.String key, java.lang.Object value, int atomSetIndex)` Sets auxiliary information for an AtomSet
    `void` | `setNoAutoBond()`
    `SymmetryInterface` | `setSymmetry(SymmetryInterface symmetry)`
    `void` | `setTensors()`
    `void` | `setTrajectory()`
    `private void` | `setTrajectoryName(java.lang.String name)`
    `void` | `setU(Atom atom, int i, float val)`

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

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

- - ### Field Detail

    - #### reader

          AtomSetCollectionReader reader

    - #### bsAtoms

          public javajs.util.BS bsAtoms

    - #### fileTypeName

          public java.lang.String fileTypeName

    - #### collectionName

          java.lang.String collectionName

    - #### atomSetInfo

          public java.util.Map<java.lang.String,java.lang.Object> atomSetInfo

    - #### globalBooleans

          private static final java.lang.String[] globalBooleans

    - #### GLOBAL_FRACTCOORD

          public static final int GLOBAL_FRACTCOORD

      See Also:
        Constant Field Values

    - #### GLOBAL_SYMMETRY

          public static final int GLOBAL_SYMMETRY

      See Also:
        Constant Field Values

    - #### GLOBAL_UNITCELLS

          public static final int GLOBAL_UNITCELLS

      See Also:
        Constant Field Values

    - #### GLOBAL_CONECT

          public static final int GLOBAL_CONECT

      See Also:
        Constant Field Values

    - #### GLOBAL_ISPDB

          public static final int GLOBAL_ISPDB

      See Also:
        Constant Field Values

    - #### GLOBAL_DOMAINS

          public static final int GLOBAL_DOMAINS

      See Also:
        Constant Field Values

    - #### GLOBAL_VALIDATIONS

          public static final int GLOBAL_VALIDATIONS

      See Also:
        Constant Field Values

    - #### atoms

          public Atom[] atoms

    - #### ac

          public int ac

    - #### bonds

          public Bond[] bonds

    - #### bondCount

          public int bondCount

    - #### structures

          public Structure[] structures

    - #### structureCount

          public int structureCount

    - #### atomSetCount

          public int atomSetCount

    - #### iSet

          public int iSet

    - #### atomSetNumbers

          private int[] atomSetNumbers

    - #### atomSetAtomIndexes

          private int[] atomSetAtomIndexes

    - #### atomSetAtomCounts

          private int[] atomSetAtomCounts

    - #### atomSetBondCounts

          private int[] atomSetBondCounts

    - #### atomSetAuxiliaryInfo

          private java.util.Map<java.lang.String,java.lang.Object>[] atomSetAuxiliaryInfo

    - #### errorMessage

          public java.lang.String errorMessage

    - #### coordinatesAreFractional

          public boolean coordinatesAreFractional

    - #### isTrajectory

          boolean isTrajectory

    - #### trajectoryStepCount

          private int trajectoryStepCount

    - #### trajectorySteps

          private javajs.util.Lst<javajs.util.P3[]> trajectorySteps

    - #### vibrationSteps

          private javajs.util.Lst<javajs.util.V3[]> vibrationSteps

    - #### trajectoryNames

          private javajs.util.Lst<java.lang.String> trajectoryNames

    - #### doFixPeriodic

          public boolean doFixPeriodic

    - #### allowMultiple

          public boolean allowMultiple

    - #### readerList

          private javajs.util.Lst<AtomSetCollectionReader> readerList

    - #### bsStructuredModels

          public javajs.util.BS bsStructuredModels

    - #### haveAnisou

          public boolean haveAnisou

    - #### baseSymmetryAtomCount

          public int baseSymmetryAtomCount

    - #### checkLatticeOnly

          public boolean checkLatticeOnly

    - #### xtalSymmetry

          public XtalSymmetry xtalSymmetry

    - #### bondIndex0

          int bondIndex0

    - #### checkSpecial

          public boolean checkSpecial

    - #### atomSymbolicMap

          public java.util.Map<java.lang.String,Atom> atomSymbolicMap

    - #### haveUnitCell

          public boolean haveUnitCell

    - #### vibScale

          public int vibScale

  - ### Constructor Detail

    - #### AtomSetCollection

          public AtomSetCollection(java.lang.String fileTypeName,
                                   AtomSetCollectionReader reader,
                                   AtomSetCollection[] array,
                                   javajs.util.Lst<?> list)

  - ### Method Detail

    - #### setCollectionName

          public void setCollectionName(java.lang.String collectionName)

    - #### clearGlobalBoolean

          public void clearGlobalBoolean(int globalIndex)

    - #### setGlobalBoolean

          public void setGlobalBoolean(int globalIndex)

    - #### getGlobalBoolean

          boolean getGlobalBoolean(int globalIndex)

    - #### appendAtomSetCollectionList

          private void appendAtomSetCollectionList(javajs.util.Lst<?> list)

    - #### setTrajectory

          public void setTrajectory()

    - #### appendAtomSetCollection

          public void appendAtomSetCollection(int collectionIndex,
                                              AtomSetCollection collection)

      Appends an AtomSetCollection
      Parameters:
        `collectionIndex` - collection index for new model number
        `collection` - AtomSetCollection to append

    - #### setNoAutoBond

          public void setNoAutoBond()

    - #### freeze

          void freeze(boolean reverseModels)

    - #### reverseAtomSets

          private void reverseAtomSets()

    - #### reverseSets

          private void reverseSets(AtomSetObject[] o,
                                   int n)

    - #### reverseObject

          private void reverseObject(java.lang.Object[] o)

    - #### reverseList

          private static void reverseList(javajs.util.Lst<?> list)

    - #### reverseArray

          private void reverseArray(int[] a)

    - #### getList

          private void getList(boolean isAltLoc)

    - #### finish

          void finish()

    - #### discardPreviousAtoms

          public void discardPreviousAtoms()

    - #### removeCurrentAtomSet

          public void removeCurrentAtomSet()

    - #### getHydrogenAtomCount

          public int getHydrogenAtomCount()

    - #### newCloneAtom

          public Atom newCloneAtom(Atom atom)
                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### cloneFirstAtomSet

          public int cloneFirstAtomSet(int atomCount)
                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### cloneAtomSetWithBonds

          public void cloneAtomSetWithBonds(boolean isLast)
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### cloneLastAtomSet

          public int cloneLastAtomSet()
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### cloneLastAtomSetFromPoints

          public int cloneLastAtomSetFromPoints(int ac,
                                                javajs.util.P3[] pts)
                                         throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getLastAtomSetAtomCount

          public int getLastAtomSetAtomCount()

    - #### getLastAtomSetAtomIndex

          public int getLastAtomSetAtomIndex()

    - #### addNewAtom

          public Atom addNewAtom()

    - #### addAtom

          public Atom addAtom(Atom atom)

    - #### addAtomWithMappedName

          public void addAtomWithMappedName(Atom atom)

    - #### addAtomWithMappedSerialNumber

          public void addAtomWithMappedSerialNumber(Atom atom)

    - #### getAtomFromName

          public Atom getAtomFromName(java.lang.String atomName)

    - #### getAtomIndex

          public int getAtomIndex(java.lang.String name)

    - #### addNewBondWithOrder

          public void addNewBondWithOrder(int atomIndex1,
                                          int atomIndex2,
                                          int order)

    - #### addNewBondFromNames

          public void addNewBondFromNames(java.lang.String atomName1,
                                          java.lang.String atomName2,
                                          int order)

    - #### addNewBondWithOrderA

          public void addNewBondWithOrderA(Atom atom1,
                                           Atom atom2,
                                           int order)

    - #### addBond

          public void addBond(Bond bond)

    - #### finalizeStructures

          public void finalizeStructures()

    - #### addStructure

          public void addStructure(Structure structure)

    - #### addVibrationVectorWithSymmetry

          public void addVibrationVectorWithSymmetry(int iatom,
                                                     float vx,
                                                     float vy,
                                                     float vz,
                                                     boolean withSymmetry)

    - #### addVibrationVector

          public javajs.util.V3 addVibrationVector(int iatom,
                                                   float x,
                                                   float y,
                                                   float z)

    - #### setCoordinatesAreFractional

          public void setCoordinatesAreFractional(boolean tf)

    - #### setAnisoBorU

          public void setAnisoBorU(Atom atom,
                                   float[] data,
                                   int type)

    - #### setU

          public void setU(Atom atom,
                           int i,
                           float val)

    - #### getXSymmetry

          public XtalSymmetry getXSymmetry()

    - #### getSymmetry

          public SymmetryInterface getSymmetry()

    - #### setSymmetry

          public SymmetryInterface setSymmetry(SymmetryInterface symmetry)

    - #### setTensors

          public void setTensors()

    - #### setInfo

          public void setInfo(java.lang.String key,
                              java.lang.Object value)

    - #### setAtomSetCollectionPartialCharges

          public boolean setAtomSetCollectionPartialCharges(java.lang.String auxKey)

      Sets the partial atomic charges based on asc auxiliary info
      Parameters:
        `auxKey` - The auxiliary key name that contains the charges
      Returns:
        true if the data exist; false if not

    - #### mapPartialCharge

          public void mapPartialCharge(java.lang.String atomName,
                                       float charge)

    - #### fixPeriodic

          private static javajs.util.P3 fixPeriodic(javajs.util.P3 pt,
                                                    javajs.util.P3 pt0)

    - #### fixPoint

          private static float fixPoint(float x,
                                        float x0)

    - #### finalizeTrajectoryAs

          public void finalizeTrajectoryAs(javajs.util.Lst<javajs.util.P3[]> trajectorySteps,
                                           javajs.util.Lst<javajs.util.V3[]> vibrationSteps)

    - #### finalizeTrajectory

          private void finalizeTrajectory()

    - #### newAtomSet

          public void newAtomSet()

      Create a new atoms set, clearing the atom map

    - #### newAtomSetClear

          public void newAtomSetClear(boolean doClearMap)

      Create a new atom set, optionally clearing the atom map.
      Parameters:
        `doClearMap` - set to false only in CastepReader

    - #### getAtomSetAtomIndex

          public int getAtomSetAtomIndex(int i)

    - #### getAtomSetAtomCount

          public int getAtomSetAtomCount(int i)

    - #### getAtomSetBondCount

          public int getAtomSetBondCount(int i)

    - #### setAtomSetName

          public void setAtomSetName(java.lang.String atomSetName)

      Sets the name for the current AtomSet
      Parameters:
        `atomSetName` - The name to be associated with the current AtomSet

    - #### setTrajectoryName

          private void setTrajectoryName(java.lang.String name)

    - #### setCurrentAtomSetNumber

          public void setCurrentAtomSetNumber(int atomSetNumber)

      Sets the number for the current AtomSet
      Parameters:
        `atomSetNumber` - The number for the current AtomSet.

    - #### setAtomSetNumber

          public void setAtomSetNumber(int index,
                                       int atomSetNumber)

    - #### setAtomSetModelProperty

          public void setAtomSetModelProperty(java.lang.String key,
                                              java.lang.String value)

      Sets a property for the current AtomSet used specifically for creating directories and plots of frequencies and molecular energies
      Parameters:
        `key` - The key for the property
        `value` - The value to be associated with the key

    - #### setAtomSetModelPropertyForSet

          public void setAtomSetModelPropertyForSet(java.lang.String key,
                                                    java.lang.String value,
                                                    int atomSetIndex)

      Sets the a property for the an AtomSet
      Parameters:
        `key` - The key for the property
        `value` - The value for the property
        `atomSetIndex` - The index of the AtomSet to get the property

    - #### setAtomProperties

          public void setAtomProperties(java.lang.String key,
                                        java.lang.Object data,
                                        int atomSetIndex,
                                        boolean isGroup)

      Parameters:
        `key` -
        `data` -
        `atomSetIndex` -
        `isGroup` -

    - #### setAtomSetPartialCharges

          boolean setAtomSetPartialCharges(java.lang.String auxKey)

      Sets the partial atomic charges based on atomSet auxiliary info
      Parameters:
        `auxKey` - The auxiliary key name that contains the charges
      Returns:
        true if the data exist; false if not

    - #### getAtomSetAuxiliaryInfoValue

          public java.lang.Object getAtomSetAuxiliaryInfoValue(int index,
                                                               java.lang.String key)

    - #### setCurrentModelInfo

          public void setCurrentModelInfo(java.lang.String key,
                                          java.lang.Object value)

      Sets auxiliary information for the AtomSet
      Parameters:
        `key` - The key for the property
        `value` - The value to be associated with the key

    - #### setModelInfoForSet

          public void setModelInfoForSet(java.lang.String key,
                                         java.lang.Object value,
                                         int atomSetIndex)

      Sets auxiliary information for an AtomSet
      Parameters:
        `key` - The key for the property
        `value` - The value for the property
        `atomSetIndex` - The index of the AtomSet to get the property

    - #### getAtomSetNumber

          int getAtomSetNumber(int atomSetIndex)

    - #### getAtomSetName

          java.lang.String getAtomSetName(int atomSetIndex)

    - #### getAtomSetAuxiliaryInfo

          public java.util.Map<java.lang.String,java.lang.Object> getAtomSetAuxiliaryInfo(int atomSetIndex)

    - #### setAtomSetEnergy

          public void setAtomSetEnergy(java.lang.String energyString,
                                       float value)

    - #### setAtomSetFrequency

          public java.lang.String setAtomSetFrequency(int mode,
                                                      java.lang.String pathKey,
                                                      java.lang.String label,
                                                      java.lang.String freq,
                                                      java.lang.String units)

    - #### getBondList

          public java.lang.String[][] getBondList()

    - #### centralize

          public void centralize()

    - #### mergeTrajectories

          void mergeTrajectories(AtomSetCollection a)

    - #### removeAtomSet

          public void removeAtomSet(int imodel)

      note that sets must be iterated from LAST to FIRST not a general method -- would mess up if we had unit cells
      Parameters:
        `imodel` -

    - #### removeLastUnselectedAtoms

          public void removeLastUnselectedAtoms()

    - #### checkNoEmptyModel

          public void checkNoEmptyModel()