Package org.apache.ignite.internal.util
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearTail(Object[] arr, int fromIdx)Nullify array elements from the given index until the firstnullelement (assuming that after the firstnulltail 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.
-
-
-
Method Detail
-
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 firstnullelement (assuming that after the firstnulltail is already cleared).- Parameters:
arr- Array.fromIdx- From index (including).
-
-