Class ArrayUtil
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.util.ArrayUtil
-
public final class ArrayUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int[]
INT_TYPE_ARRAY
static String[]
STRING_TYPE_ARRAY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Collection<T>
asCollection(T[] array)
static int[]
asIntArray(int... ints)
static int[]
asIntArray(Collection<Integer> list)
Transforms the given collection ofInteger
s to an array of primitiveint
values.static List<Integer>
asIntegerList(int... ints)
static <T> List<T>
asList(T[] array)
static boolean
isEmpty(int[] array)
static boolean
isEmpty(String[] array)
static boolean
isNotEmpty(int[] array)
static boolean
isNotEmpty(String[] array)
static int[]
subarray(int[] array, int startIndexInclusive, int endIndexExclusive)
Creates a newint
array containing the elements between start and end indices.
-
-
-
Field Detail
-
STRING_TYPE_ARRAY
public static final String[] STRING_TYPE_ARRAY
-
INT_TYPE_ARRAY
public static final int[] INT_TYPE_ARRAY
-
-
Method Detail
-
asList
public static <T> List<T> asList(T[] array)
-
asCollection
public static <T> Collection<T> asCollection(T[] array)
-
asIntArray
public static int[] asIntArray(int... ints)
-
isEmpty
public static boolean isEmpty(int[] array)
-
isEmpty
public static boolean isEmpty(String[] array)
-
isNotEmpty
public static boolean isNotEmpty(int[] array)
-
isNotEmpty
public static boolean isNotEmpty(String[] array)
-
asIntArray
public static int[] asIntArray(Collection<Integer> list)
Transforms the given collection ofInteger
s to an array of primitiveint
values.- Parameters:
list
- The collection ofInteger
s to transform- Returns:
- The array representation of primitive
int
values.
-
subarray
public static int[] subarray(int[] array, int startIndexInclusive, int endIndexExclusive)
Creates a newint
array containing the elements between start and end indices.Similar to Apache Commons Lang
ArrayUtils.subarray()
- Parameters:
array
-startIndexInclusive
-endIndexExclusive
-- Returns:
-
-