Package com.sshtools.common.util
Class Arrays
java.lang.Object
com.sshtools.common.util.Arrays
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]add(T obj, T... array) static booleanareEqual(byte[] a, byte[] b) static booleanareEqual(char[] a, char[] b) static byte[]cat(byte[] a, byte[] b) static byte[]copy(byte[] array, int len) static byte[]copy(byte[] array, int offset, int len) static voidsort(int[] a) Sorts the specified array of ints into ascending numerical order.
-
Constructor Details
-
Arrays
public Arrays()
-
-
Method Details
-
sort
public static void sort(int[] a) Sorts the specified array of ints into ascending numerical order. The sorting algorithm is a tuned quicksort, adapted from Jon L. Bentley and M. Douglas McIlroy's "Engineering a Sort Function", Software-Practice and Experience, Vol. 23(11) P. 1249-1265 (November 1993). This algorithm offers n*log(n) performance on many data sets that cause other quicksorts to degrade to quadratic performance.- Parameters:
a- the array to be sorted
-
areEqual
public static boolean areEqual(byte[] a, byte[] b) -
add
public static <T> T[] add(T obj, T... array) -
areEqual
public static boolean areEqual(char[] a, char[] b) -
copy
public static byte[] copy(byte[] array, int len) -
copy
public static byte[] copy(byte[] array, int offset, int len) -
cat
public static byte[] cat(byte[] a, byte[] b)
-