Class ArrayUtil


  • public final class ArrayUtil
    extends Object
    Provides: - utility to check for equality
    • Method Detail

      • arraysEqual

        public static boolean arraysEqual​(Object array1,
                                          Object array2)
      • arrayContainsNulls

        public static boolean arrayContainsNulls​(Object[] array)
      • newArray

        public static <T> T[] newArray​(Class<T> theClass,
                                       int numItems)
      • newArray

        public static <T> T[] newArray​(T[] items,
                                       int startIndex,
                                       int numItems)
        Create a new array from the original.
        Parameters:
        items - the original array
        startIndex - index of the first item
        numItems -
        Returns:
        an array of the same type, containing numItems items
      • newArray

        public static <T> T[] newArray​(T[] items1,
                                       T[] items2)
        Create a new array consisting of originals and new.
        Parameters:
        items1 - 1st array
        items2 - 2nd array
        Returns:
        an array of the same type as items1, its elements first
      • newArray

        public static <T> T[] newArray​(T[] items,
                                       T item)
        Create a new array consisting of an original array, and a single new item.
        Parameters:
        items - an array
        item - an item to append
        Returns:
        an array of the same type as items1, its elements first