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
ConstructorsConstructorDescriptionUnmodifiableState(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(SystemState state) This constructor does a defensive copy of all arrays. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]a()Returns the value of thearecord component.double[]Returns the value of theaPreviousrecord component.final booleanIndicates whether some other object is "equal to" this one.doubledouble[]gradient()Returns the value of thegradientrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thekineticEnergyrecord component.double[]mass()Returns the value of themassrecord component.doubleReturns the value of thepotentialEnergyrecord component.doubleReturns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.double[]v()Returns the value of thevrecord component.double[]x()Returns the value of thexrecord component.
-
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
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
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
x
-
v
-
a
-
aPrevious
-
mass
-
gradient
-
kineticEnergy
public double kineticEnergy()Returns the value of thekineticEnergyrecord component.- Returns:
- the value of the
kineticEnergyrecord component
-
potentialEnergy
public double potentialEnergy()Returns the value of thepotentialEnergyrecord component.- Returns:
- the value of the
potentialEnergyrecord component
-
temperature
public double temperature()Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-