Package org.cha0scollective.wwpg.api
Record Class ElementResult
java.lang.Object
java.lang.Record
org.cha0scollective.wwpg.api.ElementResult
public record ElementResult(double lastVoltageVolts, double meanVoltageVolts, double rmsVoltageVolts, double lastCurrentAmps, double meanCurrentAmps, double rmsCurrentAmps, double meanPowerWatts, double energyJoules)
extends Record
Valid oriented electrical measurements over the accepted substeps of one tick.
Means are arithmetic substep means; RMS is sqrt(mean(square(sample))).
meanPowerWatts is mean(V*I), not mean(V)*mean(I). energyJoules is the signed
sum of V*I*substepSeconds; positive values denote absorbed energy.
-
Constructor Summary
ConstructorsConstructorDescriptionElementResult(double lastVoltageVolts, double meanVoltageVolts, double rmsVoltageVolts, double lastCurrentAmps, double meanCurrentAmps, double rmsCurrentAmps, double meanPowerWatts, double energyJoules) Constructs ElementResult with validated captured values. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theenergyJoulesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thelastCurrentAmpsrecord component.doubleReturns the value of thelastVoltageVoltsrecord component.doubleReturns the value of themeanCurrentAmpsrecord component.doubleReturns the value of themeanPowerWattsrecord component.doubleReturns the value of themeanVoltageVoltsrecord component.doubleReturns the value of thermsCurrentAmpsrecord component.doubleReturns the value of thermsVoltageVoltsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ElementResult
public ElementResult(double lastVoltageVolts, double meanVoltageVolts, double rmsVoltageVolts, double lastCurrentAmps, double meanCurrentAmps, double rmsCurrentAmps, double meanPowerWatts, double energyJoules) Constructs ElementResult with validated captured values.- Parameters:
lastVoltageVolts- signed last voltage in volts; finite, with magnitude at most 1e15 (inclusive)meanVoltageVolts- signed mean voltage in volts; finite, with magnitude at most 1e15 (inclusive)rmsVoltageVolts- RMS voltage in volts in [0, 1e15] inclusivelastCurrentAmps- signed last current in amperes; finite, with magnitude at most 1e15 (inclusive)meanCurrentAmps- signed mean current in amperes; finite, with magnitude at most 1e15 (inclusive)rmsCurrentAmps- RMS current in amperes in [0, 1e15] inclusivemeanPowerWatts- mean signed V*I in watts; finite, with magnitude at most 1e15 (inclusive)energyJoules- signed absorbed energy in joules; finite, with magnitude at most 1e15 (inclusive)- Throws:
IllegalArgumentException- if a numeric, key, count or structural constraint is violated
-
-
Method Details
-
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. All components in this record class are compared with '=='. -
lastVoltageVolts
public double lastVoltageVolts()Returns the value of thelastVoltageVoltsrecord component.- Returns:
- the value of the
lastVoltageVoltsrecord component
-
meanVoltageVolts
public double meanVoltageVolts()Returns the value of themeanVoltageVoltsrecord component.- Returns:
- the value of the
meanVoltageVoltsrecord component
-
rmsVoltageVolts
public double rmsVoltageVolts()Returns the value of thermsVoltageVoltsrecord component.- Returns:
- the value of the
rmsVoltageVoltsrecord component
-
lastCurrentAmps
public double lastCurrentAmps()Returns the value of thelastCurrentAmpsrecord component.- Returns:
- the value of the
lastCurrentAmpsrecord component
-
meanCurrentAmps
public double meanCurrentAmps()Returns the value of themeanCurrentAmpsrecord component.- Returns:
- the value of the
meanCurrentAmpsrecord component
-
rmsCurrentAmps
public double rmsCurrentAmps()Returns the value of thermsCurrentAmpsrecord component.- Returns:
- the value of the
rmsCurrentAmpsrecord component
-
meanPowerWatts
public double meanPowerWatts()Returns the value of themeanPowerWattsrecord component.- Returns:
- the value of the
meanPowerWattsrecord component
-
energyJoules
public double energyJoules()Returns the value of theenergyJoulesrecord component.- Returns:
- the value of the
energyJoulesrecord component
-