List of utility methods to do Integer Create
int[] | toIntArray(long color) to Int Array return new int[] { 0xFF & (int) (color >> 24), 0xFF & (int) (color >> 16), 0xFF & (int) (color >> 8), 0xFF & (int) (color) }; |
int[] | toIntArray(long[] in) Convert long array to integer array int[] out = new int[in.length]; for (int i = 0; i < out.length; i++) { long value = in[i]; if (value == Long.MAX_VALUE) { value = -1; if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) { throw new IllegalArgumentException("Cannot convert to int array without data loss"); ... |
int[] | toIntArray(String intArray) to Int Array if (intArray == null || "".equals(intArray)) { return null; } else { String ints[] = intArray.split("[,]"); int[] is = new int[ints.length]; for (int i = 0; i < ints.length; i++) { is[i] = Integer.parseInt(ints[i].trim()); return is; |
int[] | toIntArray(String src) to Int Array if (src == null || src.length() == 0) { return null; int length = src.length(); int[] dst = new int[length]; for (int i = 0; i < length; i++) { dst[i] = Integer.parseInt(String.valueOf(src.charAt(i))); return dst; |
int[] | toIntArray(String str, String delimiter) to Int Array String[] strs = str.split(delimiter); int[] ints = new int[strs.length]; for (int i = 0; i < strs.length; i++) { ints[i] = Integer.parseInt(strs[i]); return ints; |
int[] | toIntArray(String str, String separator) Converts a string of numbers to an integer array yes String[] fields = str.split(separator); int[] tmp = new int[fields.length]; for (int i = 0; i < tmp.length; i++) tmp[i] = Integer.parseInt(fields[i]); return tmp; |
int[] | toIntArray(String value) to Int Array int[] intArray = null; if (value != null) { String[] splitValueArray = value.split(","); intArray = new int[splitValueArray.length]; for (int index = 0; index < splitValueArray.length; ++index) intArray[index] = Integer.parseInt(splitValueArray[index].trim()); return intArray; ... |
int[] | toIntArray(String[] anArray) to Int Array int[] output = new int[anArray.length]; for (int index = 0; index < anArray.length; index++) output[index] = Integer.parseInt(anArray[index]); return output; |
int[] | toIntArray(String[] array) to Int Array int[] result = new int[array.length]; for (int i = 0; i < array.length; i++) { result[i] = Integer.parseInt(array[i]); return result; |
int[] | toIntArray(String[] ss) to Int Array int[] is = new int[ss.length]; for (int i = 0; i < ss.length; i++) { is[i] = toInt(ss[i]); return is; |