Class BenchmarkResult

java.lang.Object
com.github.rlacher.sortbench.results.BenchmarkResult

public final class BenchmarkResult extends Object
Represents the raw, per-iteration result of a benchmark run.

This class encapsulates the profiling metrics and contextual information collected during a single execution of a sorting algorithm. Instances of this class are created by the BenchmarkRunner.

See Also:
  • Constructor Details

    • BenchmarkResult

      public BenchmarkResult(BenchmarkContext context, Benchmarker.ProfilingMode profilingMode, double value)
      Constructs a new BenchmarkResult object.
      Parameters:
      context - The benchmark context. Must not be null.
      profilingMode - The profiling mode. Must not be null.
      value - The benchmark metric value. Must not be negative.
      Throws:
      IllegalArgumentException - If context or profilingMode are null, or value is negative.
  • Method Details

    • getContext

      public BenchmarkContext getContext()
      Gets the benchmark context.
      Returns:
      The benchmark context object.
    • getProfilingMode

      public Benchmarker.ProfilingMode getProfilingMode()
      Gets the profiling mode.
      Returns:
      The profiling mode.
    • getValue

      public double getValue()
      Gets the benchmark metric value.
      Returns:
      The benchmark metric value.
    • toString

      public String toString()
      Returns a string representation of the BenchmarkResult object.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the object.
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code value for this object.