Top Description Constructors Methods
org.apache.commons.lang3

public Class ArraySorter

extends Object
Class Inheritance
Imports
java.util.Arrays, .Comparator

Sorts and returns arrays in the fluent style. TODO For 4.0, rename to ArraySort, since we cover the sort() method here, see also ArrayFill.
Since
3.12.0

Constructor Summary

AccessConstructor and Description
public
ArraySorter()
Deprecated Will be removed in 4.0.0.

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
public static byte[]

Returns:

the given array.
sort
(final byte[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static char[]

Returns:

the given array.
sort
(final char[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static double[]

Returns:

the given array.
sort
(final double[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static float[]

Returns:

the given array.
sort
(final float[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static int[]

Returns:

the given array.
sort
(final int[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static long[]

Returns:

the given array.
sort
(final long[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static short[]

Returns:

the given array.
sort
(final short[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static <
the array type.
T
>
T[]

Returns:

the given array.
sort
(final T[]
the array to sort (may be null).
array
)

Sorts the given array into ascending order and returns it.

public static <
the array type.
T
>
T[]

Returns:

the given array.
sort
(final T[]
the array to sort (may be null).
array
,
final Comparator<? super T>
the comparator to determine the order of the array. A null value uses the elements' natural ordering.
comparator
)

Sorts the given array into ascending order and returns it.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ArraySorterback to summary
public ArraySorter()

Deprecated

Will be removed in 4.0.0.

Constructs a new instance.

Annotations
@Deprecated

Method Detail

sortback to summary
public static byte[] sort(final byte[] array)

Sorts the given array into ascending order and returns it.

Parameters
array:byte[]

the array to sort (may be null).

Returns:byte[]

the given array.

See Also
Arrays#sort(byte[])
sortback to summary
public static char[] sort(final char[] array)

Sorts the given array into ascending order and returns it.

Parameters
array:char[]

the array to sort (may be null).

Returns:char[]

the given array.

See Also
Arrays#sort(char[])
sortback to summary
public static double[] sort(final double[] array)

Sorts the given array into ascending order and returns it.

Parameters
array:double[]

the array to sort (may be null).

Returns:double[]

the given array.

See Also
Arrays#sort(double[])
sortback to summary
public static float[] sort(final float[] array)

Sorts the given array into ascending order and returns it.

Parameters
array:float[]

the array to sort (may be null).

Returns:float[]

the given array.

See Also
Arrays#sort(float[])
sortback to summary
public static int[] sort(final int[] array)

Sorts the given array into ascending order and returns it.

Parameters
array:int[]

the array to sort (may be null).

Returns:int[]

the given array.

See Also
Arrays#sort(int[])
sortback to summary
public static long[] sort(final long[] array)

Sorts the given array into ascending order and returns it.

Parameters
array:long[]

the array to sort (may be null).

Returns:long[]

the given array.

See Also
Arrays#sort(long[])
sortback to summary
public static short[] sort(final short[] array)

Sorts the given array into ascending order and returns it.

Parameters
array:short[]

the array to sort (may be null).

Returns:short[]

the given array.

See Also
Arrays#sort(short[])
sortback to summary
public static <T> T[] sort(final T[] array)

Sorts the given array into ascending order and returns it.

Parameters
<T>
the array type.
array:T[]

the array to sort (may be null).

Returns:T[]

the given array.

See Also
Arrays#sort(Object[])
sortback to summary
public static <T> T[] sort(final T[] array, final Comparator<? super T> comparator)

Sorts the given array into ascending order and returns it.

Parameters
<T>
the array type.
array:T[]

the array to sort (may be null).

comparator:Comparator<? super T>

the comparator to determine the order of the array. A null value uses the elements' natural ordering.

Returns:T[]

the given array.

See Also
Arrays#sort(Object[])