Class ArrayUtils

java.lang.Object
edu.wustl.cse231s.array.ArrayUtils

public class ArrayUtils extends Object
Author:
Dennis Cosgrove
  • Constructor Details

    • ArrayUtils

      public ArrayUtils()
  • Method Details

    • swap

      public static <C> void swap(C[] array, int aIndex, int bIndex)
    • getArrayType

      public static <C> Class<C[]> getArrayType(Class<C> componentType)
    • createArray

      public static <C> C[] createArray(Class<C> componentType, int length)
    • toArrayGenerator

      public static <C> IntFunction<C[]> toArrayGenerator(C[] array)
    • 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

      public static <C> Tuple2<C[],C[]> split(C[] array, int index)