Package ffx.potential

Record Class UnmodifiableState

java.lang.Object
java.lang.Record
ffx.potential.UnmodifiableState
Record Components:
x - The coordinates.
v - The velocities.
a - The accelerations.
aPrevious - The previous accelerations.
mass - The masses.
gradient - The gradient.
kineticEnergy - The kinetic energy.
potentialEnergy - The potential energy.
temperature - The temperature.

public record UnmodifiableState(double[] x, double[] v, double[] a, double[] aPrevious, double[] mass, double[] gradient, double kineticEnergy, double potentialEnergy, double temperature) extends Record
A record class to hold the state of a system. This class is unmodifiable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UnmodifiableState(double[] x, double[] v, double[] a, double[] aPrevious, double[] mass, double[] gradient, double kineticEnergy, double potentialEnergy, double temperature)
    This constructor does a defensive copy of all arrays.
    This constructor does a defensive copy of all arrays.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    a()
    Returns the value of the a record component.
    double[]
    Returns the value of the aPrevious record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
     
    double[]
    Returns the value of the gradient record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the kineticEnergy record component.
    double[]
    Returns the value of the mass record component.
    double
    Returns the value of the potentialEnergy record component.
    double
    Returns the value of the temperature record component.
    final String
    Returns a string representation of this record class.
    double[]
    v()
    Returns the value of the v record component.
    double[]
    x()
    Returns the value of the x record component.

    Methods inherited from class java.lang.Object

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

    • UnmodifiableState

      public UnmodifiableState(double[] x, double[] v, double[] a, double[] aPrevious, double[] mass, double[] gradient, double kineticEnergy, double potentialEnergy, double temperature)
      This constructor does a defensive copy of all arrays.
    • UnmodifiableState

      public UnmodifiableState(SystemState state)
      This constructor does a defensive copy of all arrays.
      Parameters:
      state - The state used to initialize this state.
  • Method Details

    • getTotalEnergy

      public double getTotalEnergy()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
    • x

      public double[] x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • v

      public double[] v()
      Returns the value of the v record component.
      Returns:
      the value of the v record component
    • a

      public double[] a()
      Returns the value of the a record component.
      Returns:
      the value of the a record component
    • aPrevious

      public double[] aPrevious()
      Returns the value of the aPrevious record component.
      Returns:
      the value of the aPrevious record component
    • mass

      public double[] mass()
      Returns the value of the mass record component.
      Returns:
      the value of the mass record component
    • gradient

      public double[] gradient()
      Returns the value of the gradient record component.
      Returns:
      the value of the gradient record component
    • kineticEnergy

      public double kineticEnergy()
      Returns the value of the kineticEnergy record component.
      Returns:
      the value of the kineticEnergy record component
    • potentialEnergy

      public double potentialEnergy()
      Returns the value of the potentialEnergy record component.
      Returns:
      the value of the potentialEnergy record component
    • temperature

      public double temperature()
      Returns the value of the temperature record component.
      Returns:
      the value of the temperature record component