Class Measurer


  • public class Measurer
    extends Object
    Measuring class for managing and obtaining results of sorting runs.
    • Constructor Detail

      • Measurer

        public Measurer()
        A light constructor which initializes sorter.
      • Measurer

        public Measurer​(Sorter sorter)
        A constructor which initializes sorter with the object given as argument.
        Parameters:
        sorter - the Sorter object to be used by the constructed Measurer.
    • Method Detail

      • measure

        public List<Result> measure​(Cell[][] data,
                                    int column,
                                    List<String> names)
        Deprecated.
        A shorthand for the full definition of measure(Cell[][], int, List, int, Order). Used for testing and debugging.
        Parameters:
        data - a 2-D array of type Cell to be sorted.
        column - the index of the column which will be the sorting criteria.
        names - a List of type String containing names of algorithms to be run and measured.
        Returns:
        a List of type Result holding information about the sorting runs.
      • measure

        public List<Result> measure​(Cell[][] data,
                                    int column,
                                    List<String> names,
                                    int maxIter,
                                    SortAlgorithm.Order order)
        Method for running tests for different sorting algorithms. Runs a test for each name supplied. Possible names are "bubble", "insertion", "binaryInsertion", "selection", "merge", "quick", "counting".
        Parameters:
        data - a 2-D array of type Cell to be sorted.
        column - the index of the column which will be the sorting criteria.
        names - a List of type String containing names of algorithms to be run and measured.
        maxIter - maximum number of iterations. Value of -1 means unlimited iterations, <-1 means none.
        order - an enum Order (from SortAlgorithm) value determining the sorting direction.
        Returns:
        a List of type Result holding information about the sorting runs.