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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Sort
instance()
Returns a Sort instance for convenience.<T> void
<T> void
sort
(Seq<T> a, Comparator<? super T> c) <T> void
sort
(T[] a) <T> void
sort
(T[] a, int fromIndex, int toIndex) <T> void
sort
(T[] a, Comparator<? super T> c) <T> void
sort
(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
-