MCPcopy Create free account
hub / github.com/apache/commons-lang / ArraySorter

Class ArraySorter

src/main/java/org/apache/commons/lang3/ArraySorter.java:29–171  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

27 * @since 3.12.0
28 */
29public class ArraySorter {
30
31 /**
32 * Sorts the given array into ascending order and returns it.
33 *
34 * @param array the array to sort (may be null).
35 * @return the given array.
36 * @see Arrays#sort(byte[])
37 */
38 public static byte[] sort(final byte[] array) {
39 if (array != null) {
40 Arrays.sort(array);
41 }
42 return array;
43 }
44
45 /**
46 * Sorts the given array into ascending order and returns it.
47 *
48 * @param array the array to sort (may be null).
49 * @return the given array.
50 * @see Arrays#sort(char[])
51 */
52 public static char[] sort(final char[] array) {
53 if (array != null) {
54 Arrays.sort(array);
55 }
56 return array;
57 }
58
59 /**
60 * Sorts the given array into ascending order and returns it.
61 *
62 * @param array the array to sort (may be null).
63 * @return the given array.
64 * @see Arrays#sort(double[])
65 */
66 public static double[] sort(final double[] array) {
67 if (array != null) {
68 Arrays.sort(array);
69 }
70 return array;
71 }
72
73 /**
74 * Sorts the given array into ascending order and returns it.
75 *
76 * @param array the array to sort (may be null).
77 * @return the given array.
78 * @see Arrays#sort(float[])
79 */
80 public static float[] sort(final float[] array) {
81 if (array != null) {
82 Arrays.sort(array);
83 }
84 return array;
85 }
86

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…