com.badlogic.gdx.utils
Class Sort
java.lang.Object
com.badlogic.gdx.utils.Sort
public class Sort
- extends java.lang.Object
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).
- Author:
- Nathan Sweet
Constructor Summary |
Sort()
|
Method Summary |
static Sort |
instance()
Returns a Sort instance for convenience. |
|
sort(Array<T> a)
|
|
sort(Array<T> a,
java.util.Comparator<T> c)
|
|
sort(T[] a)
|
|
sort(T[] a,
java.util.Comparator<T> c)
|
|
sort(T[] a,
java.util.Comparator<T> c,
int fromIndex,
int toIndex)
|
|
sort(T[] a,
int fromIndex,
int toIndex)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Sort
public Sort()
sort
public <T> void sort(Array<T> a)
sort
public <T> void sort(T[] a)
sort
public <T> void sort(T[] a,
int fromIndex,
int toIndex)
sort
public <T> void sort(Array<T> a,
java.util.Comparator<T> c)
sort
public <T> void sort(T[] a,
java.util.Comparator<T> c)
sort
public <T> void sort(T[] a,
java.util.Comparator<T> c,
int fromIndex,
int toIndex)
instance
public static Sort instance()
- Returns a Sort instance for convenience. Multiple threads must not use this instance at the same time.
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)