Class AggregatedResult
java.lang.Object
com.github.rlacher.sortbench.results.AggregatedResult
- All Implemented Interfaces:
Comparable<AggregatedResult>
Represents the aggregated result of a benchmark run, derived from multiple
BenchmarkResult instances.
This class encapsulates the aggregated benchmark result produced by the ResultAggregator,
associating it with a specific BenchmarkContext and Benchmarker.ProfilingMode.
-
Constructor Summary
ConstructorsConstructorDescriptionAggregatedResult(BenchmarkContext context, Benchmarker.ProfilingMode profilingMode, double aggregate, int iterations) Constructs a new AggregatedResult object. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AggregatedResult other) Defines the natural comparison logic for AggregatedResult.booleanIndicates whether some other object is "equal to" this one.doubleGets the aggregated metric value.Gets the benchmark context.intGets the number of iterations.Gets the profiling mode.inthashCode()Returns a hash code value for the object.toString()Returns a string representation of the AggregatedResult object.
-
Constructor Details
-
AggregatedResult
public AggregatedResult(BenchmarkContext context, Benchmarker.ProfilingMode profilingMode, double aggregate, int iterations) Constructs a new AggregatedResult object.- Parameters:
context- The benchmark context. Must not benull.profilingMode- The profiling mode. Must not benull.aggregate- The aggregated metric value. Must not be negative.iterations- The number of iterations. Must not be negative.- Throws:
IllegalArgumentException- If context or profilingMode arenull, or aggregate or iterations are negative.
-
-
Method Details
-
compareTo
Defines the natural comparison logic for AggregatedResult.- Specified by:
compareToin interfaceComparable<AggregatedResult>- Parameters:
other- The aggregated result to be compared.- Returns:
- A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
IllegalArgumentException- if the specified object isnull.
-
getContext
Gets the benchmark context.- Returns:
- The benchmark context object.
-
getProfilingMode
Gets the profiling mode.- Returns:
- The profiling mode.
-
getAggregate
public double getAggregate()Gets the aggregated metric value.- Returns:
- The aggregate value.
-
getIterations
public int getIterations()Gets the number of iterations.- Returns:
- The number of iterations.
-
toString
Returns a string representation of the AggregatedResult object. -
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code value for the object.
-