Record Class AbstractBenchmarkRunner.GlobalStatisticsKey

java.lang.Object
java.lang.Record
it.univr.di.cstnu.util.AbstractBenchmarkRunner.GlobalStatisticsKey
Record Components:
nodes - # of nodes
contingents - # contingents
All Implemented Interfaces:
Comparable<AbstractBenchmarkRunner.GlobalStatisticsKey>
Enclosing class:
AbstractBenchmarkRunner

static record AbstractBenchmarkRunner.GlobalStatisticsKey(int nodes, int contingents) extends Record implements Comparable<AbstractBenchmarkRunner.GlobalStatisticsKey>
Represents a key composed by (nodes, contingents) used to group the global statistics.

Implements a natural order based on the increasing pair (nodes, contingents).

Author:
posenato
  • Constructor Details

    • GlobalStatisticsKey

      GlobalStatisticsKey(int nodes, int contingents)
      Creates an instance of a GlobalStatisticsKey record class.
      Parameters:
      nodes - the value for the nodes record component
      contingents - the value for the contingents record component
  • Method Details

    • compareTo

      public int compareTo(@Nonnull AbstractBenchmarkRunner.GlobalStatisticsKey o)
      The order is with respect to #nodes and, then, #contingents. It is consistent with the record-generated equals.
      Specified by:
      compareTo in interface Comparable<AbstractBenchmarkRunner.GlobalStatisticsKey>
      Parameters:
      o - the object to be compared.
      Returns:
      negative if this has, in order, fewer nodes or fewer contingents than the parameter 'o'; a positive value in the opposite case; 0 when both values are equal to the corresponding values in 'o'.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • nodes

      public int nodes()
      Returns the value of the nodes record component.
      Returns:
      the value of the nodes record component
    • contingents

      public int contingents()
      Returns the value of the contingents record component.
      Returns:
      the value of the contingents record component