Package arc.struct
Class Sort
java.lang.Object
arc.struct.Sort
Provides methods to sort arrays of objects. Sorting requires working memory and this class allows that memory to be reused to
avoid allocation. The sorting is otherwise identical to the Arrays.sort methods (uses timsort).
Note that sorting primitive arrays with the Arrays.sort methods does not allocate memory (unless sorting large arrays of char, short, or byte).
Note that sorting primitive arrays with the Arrays.sort methods does not allocate memory (unless sorting large arrays of char, short, or byte).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Sortinstance()Returns a Sort instance for convenience.<T> void<T> voidsort(Seq<T> a, Comparator<? super T> c) <T> voidsort(T[] a) <T> voidsort(T[] a, int fromIndex, int toIndex) <T> voidsort(T[] a, Comparator<? super T> c) <T> voidsort(T[] a, Comparator<? super T> c, int fromIndex, int toIndex)
-
Constructor Details
-
Sort
public Sort()
-
-
Method Details
-
instance
Returns a Sort instance for convenience. Multiple threads must not use this instance at the same time. -
sort
-
sort
public <T> void sort(T[] a) -
sort
public <T> void sort(T[] a, int fromIndex, int toIndex) -
sort
-
sort
-
sort
-