Enum Class SortingMethod

java.lang.Object
java.lang.Enum<SortingMethod>
com.irurueta.sorting.SortingMethod
All Implemented Interfaces:
Serializable, Comparable<SortingMethod>, Constable

public enum SortingMethod extends Enum<SortingMethod>
Enumerator containing different algorithms for sorting arrays of data.
  • Enum Constant Details

    • STRAIGHT_INSERTION_SORTING_METHOD

      public static final SortingMethod STRAIGHT_INSERTION_SORTING_METHOD
      Sorts data by using a straight insertion algorithm. This is a simple yet slow algorithm for sorting, although for small arrays might be fast enough.
    • SHELL_SORTING_METHOD

      public static final SortingMethod SHELL_SORTING_METHOD
      Sorts data using Shell's sorting algorithm. This algorithm is an improvement over the straight insertion algorithm to achieve faster results.
    • QUICKSORT_SORTING_METHOD

      public static final SortingMethod QUICKSORT_SORTING_METHOD
      Sorts data using Quicksort algorithm. This is the fastest algorithm in average for sorting arrays of any size.
    • HEAPSORT_SORTING_METHOD

      public static final SortingMethod HEAPSORT_SORTING_METHOD
      Sorts data using Heapsort algorithm. This algorithm is based on the idea of sorted trees, and performs better than straight insertions.
    • SYSTEM_SORTING_METHOD

      public static final SortingMethod SYSTEM_SORTING_METHOD
      Uses Java SDK sorting algorithm. Performance depends on SDK implementation and functionality is limited to sorting only (indices cannot be retrieved).
  • Constructor Details

    • SortingMethod

      private SortingMethod()
  • Method Details

    • values

      public static SortingMethod[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SortingMethod valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null