Package ffx.xray.scatter
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
ConstructorsConstructorDescriptionXRayScatteringParameters(String name, int atomicNumber, int charge, int numberOfGaussians, double[][] formFactor) Creates an instance of aXRayScatteringParametersrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theatomicNumberrecord component.intcharge()Returns the value of thechargerecord component.final booleanIndicates whether some other object is "equal to" this one.double[][]Returns the value of theformFactorrecord component.static XRayScatteringParametersgetFormFactor(int atomicNumber, int charge, boolean use3G) Retrieves the scattering parameters based on the provided atomic parameters and preference for using 3 Gaussian parameters.static XRayScatteringParametersgetFormFactorCCTBX(int atomicNumber, int charge) Get the CCTBX 3 Gaussian scattering parameters.static XRayScatteringParametersgetFormFactorSuCoppens(int atomicNumber, int charge) Get the Su and Coppens scattering parameters.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.intReturns the value of thenumberOfGaussiansrecord component.toString()Returns a string representation of the X-Ray scattering parameters.
-
Constructor Details
-
XRayScatteringParameters
public XRayScatteringParameters(String name, int atomicNumber, int charge, int numberOfGaussians, double[][] formFactor) Creates an instance of aXRayScatteringParametersrecord class.- Parameters:
name- the value for thenamerecord componentatomicNumber- the value for theatomicNumberrecord componentcharge- the value for thechargerecord componentnumberOfGaussians- the value for thenumberOfGaussiansrecord componentformFactor- the value for theformFactorrecord component
-
-
Method Details
-
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. -
getFormFactor
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
Get the Su and Coppens scattering parameters.- Parameters:
atomicNumber- The atomic number.charge- The formal charge of the atom.- Returns:
- The scattering parameters.
-
getFormFactorCCTBX
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
atomicNumber
public int atomicNumber()Returns the value of theatomicNumberrecord component.- Returns:
- the value of the
atomicNumberrecord component
-
charge
public int charge()Returns the value of thechargerecord component.- Returns:
- the value of the
chargerecord component
-
numberOfGaussians
public int numberOfGaussians()Returns the value of thenumberOfGaussiansrecord component.- Returns:
- the value of the
numberOfGaussiansrecord component
-
formFactor
public double[][] formFactor()Returns the value of theformFactorrecord component.- Returns:
- the value of the
formFactorrecord component
-