Package com.irurueta.sorting
Enum Class SortingMethod
- All Implemented Interfaces:
Serializable
,Comparable<SortingMethod>
,Constable
Enumerator containing different algorithms for sorting arrays of data.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSorts data using Heapsort algorithm.Sorts data using Quicksort algorithm.Sorts data using Shell's sorting algorithm.Sorts data by using a straight insertion algorithm.Uses Java SDK sorting algorithm. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SortingMethod
Returns the enum constant of this class with the specified name.static SortingMethod[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Sorts data using Shell's sorting algorithm. This algorithm is an improvement over the straight insertion algorithm to achieve faster results. -
QUICKSORT_SORTING_METHOD
Sorts data using Quicksort algorithm. This is the fastest algorithm in average for sorting arrays of any size. -
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
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
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
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 nameNullPointerException
- if the argument is null
-