Class MainCommand

java.lang.Object
com.github.rlacher.sortbench.MainCommand
All Implemented Interfaces:
Callable<Integer>

public class MainCommand extends Object implements Callable<Integer>
The entry point for the sorting algorithm benchmarking application.

This class runs the sorting algorithms.

  • Method Details

    • call

      public Integer call() throws Exception
      Initialises and runs the sorting algorithm benchmarking process.

      This method is called when the command line interface (CLI) is executed. It sets up the logging format, validates the input parameters, and runs the benchmark. It uses the Sorter class to run the benchmark and the BenchmarkRunner class to orchestrate the benchmarking process. It also uses theResultAggregator class to process the benchmark results and the AsciiTableFormatter class to format the output.

      Specified by:
      call in interface Callable<Integer>
      Returns:
      Exits with code 0 if successful (non-zero exit codes indicate errors).
      Throws:
      Exception
    • main

      public static void main(String[] args)
      The main method, which starts the sorting algorithm benchmarking process.

      This method merely executes the command line interface (CLI) using the CommandLine class and processes its exit code.

      Parameters:
      args - Command-line arguments.