Class AtomType

  • All Implemented Interfaces:
    Comparator<String>

    @FFXKeyword(name="atom",
                clazz=java.lang.String.class,
                keywordGroup=PotentialFunctionParameter,
                description="[2 integers, name, quoted string, integer, real and integer] Provides the values needed to define a single force field atom type. The first two integer modifiers denote the atom type and class numbers. If the type and class are identical, only a single integer value is required. The next modifier is a three-character atom name, followed by an 24-character or less atom description contained in single quotes. The next two modifiers are the atomic number and atomic mass. The final integer modifier is the \"valence\" of the atom, defined as the expected number of attached or bonded atoms.")
    public final class AtomType
    extends BaseType
    implements Comparator<String>
    The AtomType class represents one molecular mechanics atom type.
    Since:
    1.0
    Author:
    Michael J. Schnieders
    • Field Detail

      • name

        public final String name
        Short name (ie CH3/CH2 etc).
      • environment

        public final String environment
        Description of the atom's bonding environment.
      • atomicNumber

        public final int atomicNumber
        Atomic Number.
      • atomicWeight

        public final double atomicWeight
        Atomic weight. "An atomic weight (relative atomic weight) of an element from a specified source is the ratio of the average atomicWeight per atom of the element to 1/12 of the atomicWeight of an atom of 12C"
      • valence

        public final int valence
        Valence number for this type.
      • type

        public int type
        Atom type.
      • atomClass

        public int atomClass
        Atom class.
    • Constructor Detail

      • AtomType

        public AtomType​(int type,
                        int atomClass,
                        String name,
                        String environment,
                        int atomicNumber,
                        double atomicWeight,
                        int valence)
        AtomType Constructor.
        Parameters:
        type - int
        atomClass - int
        name - String
        environment - String
        atomicNumber - int
        atomicWeight - double
        valence - int
    • Method Detail

      • parse

        public static AtomType parse​(String input,
                                     String[] tokens)
        Construct an AtomType from an input string.
        Parameters:
        input - The overall input String.
        tokens - The input String tokenized.
        Returns:
        an AtomType instance.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()

        Basic toString method.

        Nicely formatted atom type string.

        Overrides:
        toString in class BaseType
      • checkAtomicNumberAndMass

        public static boolean checkAtomicNumberAndMass​(int atomicNumber,
                                                       double mass)
        Check if the supplied atomic mass is within 0.1 AMU of the IUPAC value for the given atomic number.

        For atomic numbers outside the range 1 to 118, true always is returned.

        Parameters:
        atomicNumber - The atomic number.
        mass - The atomic mass.
        Returns:
        True if the given mass is within the given tolerance of the IUPAC value for the atomic number.
      • checkAtomicNumberAndMass

        public static boolean checkAtomicNumberAndMass​(int atomicNumber,
                                                       double mass,
                                                       double tolerance)
        Check if the supplied atomic mass is within the supplied tolerance (in AMU) of the IUPAC value for the given atomic number.

        For atomic numbers outside the range 1 to 118, true always is returned.

        Parameters:
        atomicNumber - The atomic number.
        mass - The atomic mass.
        tolerance - The error tolerance in AMU.
        Returns:
        True if the given mass is within the given tolerance of the IUPAC value for the atomic number.