Class GridArrays

java.lang.Object
org.apache.ignite.internal.util.GridArrays

public final class GridArrays extends Object
Utility methods to work with arrays.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    clearTail(Object[] arr, int fromIdx)
    Nullify array elements from the given index until the first null element (assuming that after the first null tail is already cleared).
    static long[]
    remove(long[] arr, int idx)
     
    static <T> T[]
    remove(T[] arr, int idx)
     
    static <T> T[]
    set(T[] arr, int idx, T o)
    Set element to the array at the given index.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • set

      public static <T> T[] set(T[] arr, int idx, T o)
      Set element to the array at the given index. Grows the array if needed.
      Parameters:
      arr - Array.
      idx - Index.
      o - Object.
      Returns:
      The given or grown array.
    • remove

      public static <T> T[] remove(T[] arr, int idx)
      Parameters:
      arr - Array.
      idx - Index to remove.
      Returns:
      Smaller array.
    • remove

      public static long[] remove(long[] arr, int idx)
      Parameters:
      arr - Array.
      idx - Index to remove.
      Returns:
      Smaller array.
    • clearTail

      public static void clearTail(Object[] arr, int fromIdx)
      Nullify array elements from the given index until the first null element (assuming that after the first null tail is already cleared).
      Parameters:
      arr - Array.
      fromIdx - From index (including).