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
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
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. -
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 '=='. -
x
public double[] x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
v
public double[] v()Returns the value of thevrecord component.- Returns:
- the value of the
vrecord component
-
a
public double[] a()Returns the value of thearecord component.- Returns:
- the value of the
arecord component
-
aPrevious
public double[] aPrevious()Returns the value of theaPreviousrecord component.- Returns:
- the value of the
aPreviousrecord component
-
mass
public double[] mass()Returns the value of themassrecord component.- Returns:
- the value of the
massrecord component
-
gradient
public double[] gradient()Returns the value of thegradientrecord component.- Returns:
- the value of the
gradientrecord component
-
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
-