List of utility methods to do Array
String | arrayTransfer(int[] ids) array Transfer System.out.println("DataUtils.arrayTransfer()"); if (ids != null && ids.length != 0) { StringBuffer str = new StringBuffer(""); for (int i = 0; i < ids.length; i++) { str.append(ids[i] + ","); return str.toString().substring(0, str.toString().length() - 1); return ""; |
String | arrayType(String type) array Type if (isArray(type)) if (type.length() == arrayDimSize(type) + 1) { return type; } else { String ans = "Ljava/lang/Object;"; for (int j = 0; j < arrayDimSize(type); j++) { ans = "[" + ans; return ans; return null; |
String | arrayTypeToZeroLengthArray(String arrayType) array Type To Zero Length Array int o = arrayType.indexOf("[]"); if (o < 0) { throw new IllegalStateException("Not a array type"); StringBuffer sb = new StringBuffer(); sb.append(arrayType.substring(0, o)).append("[0]"); return sb.toString(); |
String | arrayUnEscape(String string) array Un Escape string = string.replaceAll("%2", ","); string = string.replaceAll("%1", "%"); return string; |
boolean | arrayValid(Object[] objects) array Valid if (objects != null && objects.length > 0) { return true; } else { return false; |
int | arrayValidLength(int[] array) Returns length of the array discounting the trailing elements with zero value. int len = array.length; while (len > 0 && array[len - 1] == 0) { --len; return len <= 0 ? 0 : len; |
String[] | arrayWithoutFirstElement(final String[] array) Get an array without the first element of the input array. return arrayWithoutFirstsElement(array, 1);
|