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

    Constructors
    Constructor
    Description
    ElementResult(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 Type
    Method
    Description
    double
    Returns the value of the energyJoules record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the lastCurrentAmps record component.
    double
    Returns the value of the lastVoltageVolts record component.
    double
    Returns the value of the meanCurrentAmps record component.
    double
    Returns the value of the meanPowerWatts record component.
    double
    Returns the value of the meanVoltageVolts record component.
    double
    Returns the value of the rmsCurrentAmps record component.
    double
    Returns the value of the rmsVoltageVolts record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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] inclusive
      lastCurrentAmps - 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] inclusive
      meanPowerWatts - 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

      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. All components in this record class 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.
    • lastVoltageVolts

      public double lastVoltageVolts()
      Returns the value of the lastVoltageVolts record component.
      Returns:
      the value of the lastVoltageVolts record component
    • meanVoltageVolts

      public double meanVoltageVolts()
      Returns the value of the meanVoltageVolts record component.
      Returns:
      the value of the meanVoltageVolts record component
    • rmsVoltageVolts

      public double rmsVoltageVolts()
      Returns the value of the rmsVoltageVolts record component.
      Returns:
      the value of the rmsVoltageVolts record component
    • lastCurrentAmps

      public double lastCurrentAmps()
      Returns the value of the lastCurrentAmps record component.
      Returns:
      the value of the lastCurrentAmps record component
    • meanCurrentAmps

      public double meanCurrentAmps()
      Returns the value of the meanCurrentAmps record component.
      Returns:
      the value of the meanCurrentAmps record component
    • rmsCurrentAmps

      public double rmsCurrentAmps()
      Returns the value of the rmsCurrentAmps record component.
      Returns:
      the value of the rmsCurrentAmps record component
    • meanPowerWatts

      public double meanPowerWatts()
      Returns the value of the meanPowerWatts record component.
      Returns:
      the value of the meanPowerWatts record component
    • energyJoules

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