Class ArrayUtils
java.lang.Object
edu.wustl.cse231s.array.ArrayUtils
- Author:
- Dennis Cosgrove
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> intbinarySearchForKeyOrInsertionPointOfKey(C[] array, int fromIndex, int toIndex, C key, Comparator<C> comparator) static <C> intbinarySearchForKeyOrInsertionPointOfKey(C[] array, C key, Comparator<C> comparator) static <C> C[]concat(C[] a, C[] b) static <C> C[]copyOf(C[] src) static <C> C[]createArray(Class<C> componentType, int length) static <C> Class<C[]> getArrayType(Class<C> componentType) static <C> Tuple2<C[], C[]> split(C[] array, int index) static <C> voidswap(C[] array, int aIndex, int bIndex) static <C> IntFunction<C[]> toArrayGenerator(C[] array)
-
Constructor Details
-
ArrayUtils
public ArrayUtils()
-
-
Method Details
-
swap
public static <C> void swap(C[] array, int aIndex, int bIndex) -
getArrayType
-
createArray
-
toArrayGenerator
-
copyOf
public static <C> C[] copyOf(C[] src) -
concat
public static <C> C[] concat(C[] a, C[] b) -
binarySearchForKeyOrInsertionPointOfKey
public static <C> int binarySearchForKeyOrInsertionPointOfKey(C[] array, C key, Comparator<C> comparator) -
binarySearchForKeyOrInsertionPointOfKey
public static <C> int binarySearchForKeyOrInsertionPointOfKey(C[] array, int fromIndex, int toIndex, C key, Comparator<C> comparator) -
split
-