Package org.apache.ignite.internal.util
Class GridArrays
java.lang.Object
org.apache.ignite.internal.util.GridArrays
Utility methods to work with arrays.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidNullify 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 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
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).
-