public static Object concat(Object arr1, Object arr2, Object arr3) { return concat(new Object[] {arr1, arr2, arr3}); }
commonComponentType = (commonComponentType == null) ? componentType : commonClass(commonComponentType, componentType); return concat(Array.newInstance(commonComponentType, totalLen), totalLen, arrs);
/** * Concatenates two arrays into one. If arr1 is null or empty, returns arr2. * If arr2 is null or empty, returns arr1. May return null if both arrays are null, * or one is empty and the other null. <br> * The concatenated array has componentType which is compatible with both input arrays (or Object[]) * * @param arr1 input array * @param arr2 input array * * @return Object the concatenated array, elements of arr1 first */ public static Object concat(Object arr1, Object arr2) { int len1 = (arr1 == null) ? (-1) : Array.getLength(arr1); if (len1 <= 0) { return arr2; } int len2 = (arr2 == null) ? (-1) : Array.getLength(arr2); if (len2 <= 0) { return arr1; } Class commonComponentType = commonClass(arr1.getClass().getComponentType(), arr2.getClass().getComponentType()); Object newArray = Array.newInstance(commonComponentType, len1 + len2); System.arraycopy(arr1, 0, newArray, 0, len1); System.arraycopy(arr2, 0, newArray, len1, len2); return newArray; }
if(ArrayUtils.contains(bodyrows, rowIndex))
commonComponentType = (commonComponentType == null) ? componentType : commonClass(commonComponentType, componentType); return concat(Array.newInstance(commonComponentType, totalLen), totalLen, arrs);
/** * Concatenates two arrays into one. If arr1 is null or empty, returns arr2. * If arr2 is null or empty, returns arr1. May return null if both arrays are null, * or one is empty and the other null. <br> * The concatenated array has componentType which is compatible with both input arrays (or Object[]) * * @param arr1 input array * @param arr2 input array * * @return Object the concatenated array, elements of arr1 first */ public static Object concat(Object arr1, Object arr2) { int len1 = (arr1 == null) ? (-1) : Array.getLength(arr1); if (len1 <= 0) { return arr2; } int len2 = (arr2 == null) ? (-1) : Array.getLength(arr2); if (len2 <= 0) { return arr1; } Class commonComponentType = commonClass(arr1.getClass().getComponentType(), arr2.getClass().getComponentType()); Object newArray = Array.newInstance(commonComponentType, len1 + len2); System.arraycopy(arr1, 0, newArray, 0, len1); System.arraycopy(arr2, 0, newArray, len1, len2); return newArray; }
if(ArrayUtils.contains(bodyrows, rowIndex))
public static Object concat(Object arr1, Object arr2, Object arr3) { return concat(new Object[] {arr1, arr2, arr3}); }
commonComponentType = (commonComponentType == null) ? componentType : commonClass(commonComponentType, componentType); return concat(Array.newInstance(commonComponentType, totalLen), totalLen, arrs);
/** * Concatenates two arrays into one. If arr1 is null or empty, returns arr2. * If arr2 is null or empty, returns arr1. May return null if both arrays are null, * or one is empty and the other null. <br> * The concatenated array has componentType which is compatible with both input arrays (or Object[]) * * @param arr1 input array * @param arr2 input array * * @return Object the concatenated array, elements of arr1 first */ public static Object concat(Object arr1, Object arr2) { int len1 = (arr1 == null) ? (-1) : Array.getLength(arr1); if (len1 <= 0) { return arr2; } int len2 = (arr2 == null) ? (-1) : Array.getLength(arr2); if (len2 <= 0) { return arr1; } Class commonComponentType = commonClass(arr1.getClass().getComponentType(), arr2.getClass().getComponentType()); Object newArray = Array.newInstance(commonComponentType, len1 + len2); System.arraycopy(arr1, 0, newArray, 0, len1); System.arraycopy(arr2, 0, newArray, len1, len2); return newArray; }
if(ArrayUtils.contains(bodyrows, currentRow))
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4) { return concat(new Object[] {arr1, arr2, arr3, arr4}); }
if(ArrayUtils.contains(bodyrows, currentRow))
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4, Object arr5) { return concat(new Object[] {arr1, arr2, arr3, arr4, arr5}); }
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4, Object arr5) { return concat(new Object[] {arr1, arr2, arr3, arr4, arr5}); }
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4) { return concat(new Object[] {arr1, arr2, arr3, arr4}); }
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4, Object arr5) { return concat(new Object[] {arr1, arr2, arr3, arr4, arr5}); }
public static Object concat(Object arr1, Object arr2, Object arr3) { return concat(new Object[] {arr1, arr2, arr3}); }
public static Object concat(Object arr1, Object arr2, Object arr3, Object arr4) { return concat(new Object[] {arr1, arr2, arr3, arr4}); }
public static Object concatSameType(Object toArray, Object[] arrs) { int totalLen = 0; for (int i = 0, len = arrs.length; i < len; i++) { if (arrs[i] != null) { totalLen += Array.getLength(arrs[i]); } } return concat(toArray, totalLen, arrs); }