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
ConstructorDescriptionUnmodifiableState
(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 thea
record component.double[]
Returns the value of theaPrevious
record component.final boolean
Indicates whether some other object is "equal to" this one.double
double[]
gradient()
Returns the value of thegradient
record component.final int
hashCode()
Returns a hash code value for this object.double
Returns the value of thekineticEnergy
record component.double[]
mass()
Returns the value of themass
record component.double
Returns the value of thepotentialEnergy
record component.double
Returns the value of thetemperature
record component.final String
toString()
Returns a string representation of this record class.double[]
v()
Returns the value of thev
record component.double[]
x()
Returns the value of thex
record 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 thex
record component.- Returns:
- the value of the
x
record component
-
v
public double[] v()Returns the value of thev
record component.- Returns:
- the value of the
v
record component
-
a
public double[] a()Returns the value of thea
record component.- Returns:
- the value of the
a
record component
-
aPrevious
public double[] aPrevious()Returns the value of theaPrevious
record component.- Returns:
- the value of the
aPrevious
record component
-
mass
public double[] mass()Returns the value of themass
record component.- Returns:
- the value of the
mass
record component
-
gradient
public double[] gradient()Returns the value of thegradient
record component.- Returns:
- the value of the
gradient
record component
-
kineticEnergy
public double kineticEnergy()Returns the value of thekineticEnergy
record component.- Returns:
- the value of the
kineticEnergy
record component
-
potentialEnergy
public double potentialEnergy()Returns the value of thepotentialEnergy
record component.- Returns:
- the value of the
potentialEnergy
record component
-
temperature
public double temperature()Returns the value of thetemperature
record component.- Returns:
- the value of the
temperature
record component
-