The list of methods to do Array Add are organized into topic(s).
double[]
addArray(double[] array1, double[] array2) add Array
if (array1.length != array2.length) {
throw new IllegalArgumentException("The dimensions have to be equal!");
double[] result = new double[array1.length];
assert array1.length == array2.length;
for (int i = 0; i < array1.length; i++) {
result[i] = array1[i] + array2[i];
return result;
int[]
addArray(int[] a, int p) Add element to the end of the array
int[] b = new int[a.length + 1];
System.arraycopy(a, 0, b, 0, a.length);
b[a.length] = p;
return b;
int[]
addArray(int[] a, int[] b) add Array
int[] result = null;
if (a != null && b != null) {
result = new int[a.length + b.length];
System.arraycopy(a, 0, result, 0, a.length);
System.arraycopy(b, 0, result, a.length, b.length);
} else {
if (b != null)
return b;
...
Object[]
addArray(Object[] Old, Object[] New) add Array
Object[] result = new Object[Old.length + New.length];
for (int zahl = 0; zahl < result.length; zahl++)
if (zahl < Old.length)
result[zahl] = Old[zahl];
else
result[zahl] = New[zahl - Old.length];
return result;
Object[][]
addArray(Object[][] first, Object[][]... more) add Array
int len = first.length;
for (int i = 0; i < more.length; i++) {
Object[][] next = more[i];
len += next.length;
Object[][] result = new Object[len][];
int count = 0;
for (int i = 0; i < first.length; i++) {
...
byte[]
addArrayAll(byte[] array1, byte[] array2) add Array All
if (array1 == null)
return clone(array2);
if (array2 == null) {
return clone(array1);
byte[] joinedArray = new byte[array1.length + array2.length];
System.arraycopy(array1, 0, joinedArray, 0, array1.length);
System.arraycopy(array2, 0, joinedArray, array1.length, array2.length);
...
byte[]
addArrayElements(byte[] toArray, byte[] fromArray) adds the elements of the fromArray to the toArray.
byte[] newToArray = new byte[toArray.length + fromArray.length];
System.arraycopy(toArray, 0, newToArray, 0, toArray.length);
System.arraycopy(fromArray, 0, newToArray, toArray.length, fromArray.length);
return newToArray;
int[]
addArrays(final int[] a, final int[] b) Adds two arrays together and returns a new array with the sum.
int[] c = new int[a.length];
for (int i = 0; i < a.length; i++)
c[i] = a[i] + b[i];
return c;