Record Class XRayScatteringParameters

java.lang.Object
java.lang.Record
ffx.xray.scatter.XRayScatteringParameters

public record XRayScatteringParameters(String name, int atomicNumber, int charge, int numberOfGaussians, double[][] formFactor) extends Record
The XRayScatteringParameters class is a record used to store and access X-ray scattering parameters for specific atoms or elements. It provides methods to retrieve such parameters based on their atomic properties or a unique key. Instances of this class consist of an atom's name, a description, and its associated X-ray form factor data.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Summary

    Constructors
    Constructor
    Description
    XRayScatteringParameters(String name, int atomicNumber, int charge, int numberOfGaussians, double[][] formFactor)
    Creates an instance of a XRayScatteringParameters record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the atomicNumber record component.
    int
    Returns the value of the charge record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double[][]
    Returns the value of the formFactor record component.
    getFormFactor(int atomicNumber, int charge, boolean use3G)
    Retrieves the scattering parameters based on the provided atomic parameters and preference for using 3 Gaussian parameters.
    getFormFactorCCTBX(int atomicNumber, int charge)
    Get the CCTBX 3 Gaussian scattering parameters.
    getFormFactorSuCoppens(int atomicNumber, int charge)
    Get the Su and Coppens scattering parameters.
    final int
    Returns a hash code value for this object.
    Returns the value of the name record component.
    int
    Returns the value of the numberOfGaussians record component.
    Returns a string representation of the X-Ray scattering parameters.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • XRayScatteringParameters

      public XRayScatteringParameters(String name, int atomicNumber, int charge, int numberOfGaussians, double[][] formFactor)
      Creates an instance of a XRayScatteringParameters record class.
      Parameters:
      name - the value for the name record component
      atomicNumber - the value for the atomicNumber record component
      charge - the value for the charge record component
      numberOfGaussians - the value for the numberOfGaussians record component
      formFactor - the value for the formFactor record component
  • Method Details

    • toString

      public String toString()
      Returns a string representation of the X-Ray scattering parameters. The string includes the atom name, description, the first form factor element, and the array of additional form factor parameters.
      Specified by:
      toString in class Record
      Returns:
      A formatted string representation of the object.
    • getFormFactor

      public static XRayScatteringParameters getFormFactor(int atomicNumber, int charge, boolean use3G)
      Retrieves the scattering parameters based on the provided atomic parameters and preference for using 3 Gaussian parameters.
      Parameters:
      atomicNumber - the atomic number of the element.
      charge - the formal charge of the atom.
      use3G - a boolean flag indicating whether to prefer 3 Gaussian parameters if available.
      Returns:
      The X-ray scattering parameters, or null if no matching data is found.
    • getFormFactorSuCoppens

      public static XRayScatteringParameters getFormFactorSuCoppens(int atomicNumber, int charge)
      Get the Su and Coppens scattering parameters.
      Parameters:
      atomicNumber - The atomic number.
      charge - The formal charge of the atom.
      Returns:
      The scattering parameters.
    • getFormFactorCCTBX

      public static XRayScatteringParameters getFormFactorCCTBX(int atomicNumber, int charge)
      Get the CCTBX 3 Gaussian scattering parameters.
      Parameters:
      atomicNumber - The atomic number.
      charge - The formal charge of the atom.
      Returns:
      The scattering parameters.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • atomicNumber

      public int atomicNumber()
      Returns the value of the atomicNumber record component.
      Returns:
      the value of the atomicNumber record component
    • charge

      public int charge()
      Returns the value of the charge record component.
      Returns:
      the value of the charge record component
    • numberOfGaussians

      public int numberOfGaussians()
      Returns the value of the numberOfGaussians record component.
      Returns:
      the value of the numberOfGaussians record component
    • formFactor

      public double[][] formFactor()
      Returns the value of the formFactor record component.
      Returns:
      the value of the formFactor record component