List of utility methods to do Integer Array Create
int[] | intArray(double a, double b, double c) Helper method to avoid lots of explicit casts in getShape(). return new int[] { (int) a, (int) b, (int) c }; |
Integer[] | intArray(int len) int Array return new Integer[len]; |
int[] | intArray(Integer... values) int Array int[] result = new int[values.length]; for (int i = 0; i < values.length; ++i) { result[i] = values[i]; return result; |
int[] | intArray(String data) int Array if (data == null || data.equals("")) return new int[0]; String[] split = data.split(" "); int[] r = new int[split.length]; for (int i = 0; i < r.length; i++) { try { r[i] = Integer.parseInt(split[i]); } catch (NumberFormatException e) { ... |
int[] | intArrayConcat(int[] a, int[] b) Return a new int[] which is the concatenation of a and b int[] retval = new int[a.length + b.length]; System.arraycopy(a, 0, retval, 0, a.length); System.arraycopy(b, 0, retval, a.length, b.length); return retval; |
boolean | intArrayContains(int val, int[] array) Returns true if int array 'array' contains value 'val'. for (int i = 0; i < array.length; i++) if (val == array[i]) return true; return false; |
boolean | intArrayContains(int[] array, int key) int Array Contains for (final int i : array) { if (i == key) { return true; return false; |
boolean | intArrayEquals(int[] a1, int[] a2) Compare two int arrays for equality return intArrayEquals(a1, 0, a2, 0, a1 == null ? 0 : a1.length);
|
int[] | intArrayFromString(final String data) int Array From String final int[] result; if (data.equals(CONFIG_EMPTY)) { result = null; } else { final String[] split = data.split(CONFIG_SEPARATOR_ARRAY); result = new int[split.length]; for (int i = 0; i < split.length; i++) { result[i] = Integer.parseInt(split[i].trim()); ... |
int[] | intArrayFromString(String record) int Array From String return intArrayFromString(record, DEF_FIELD_DELIM);
|