Class Result


  • public class Result
    extends Object
    A simple class for holding results of a sorting run. Used mainly by the Measurer class. Fields not used in the chosen constructor are set to null.
    • Constructor Detail

      • Result

        public Result​(String name,
                      double time,
                      boolean complete,
                      Cell[][] data)
        A constructor for storing the Result of a successful sorting run.
        Parameters:
        name - a String with the name of the algorithm used.
        time - a double. Length of time taken to perform the sorting.
        complete - a boolean value of whether sorting could be completed in the given number of iterations.
        data - a 2-D array of type Cell storing sorted data.
      • Result

        public Result​(String name,
                      String errMessage)
        A constructor for storing the Result of a failed sorting run.
        Parameters:
        name - a String with the name of the algorithm used.
        errMessage - a String with the error message generated while sorting.
    • Method Detail

      • getName

        public String getName()
      • getTime

        public double getTime()
      • getData

        public Cell[][] getData()
      • isError

        public boolean isError()
        A method to determine whether an error occurred.
        Returns:
        true if there was an error, otherwise false
      • isComplete

        public boolean isComplete()
      • getErrMessage

        public String getErrMessage()
      • printResults

        public static void printResults​(@NonNull
                                        List<Result> results)
        Deprecated.
        A method to print out results of sorting runs to consoles. For debug and diagnostic use only
        Parameters:
        results - a List of results to be printed out.