Implement rest of the Arrays#fill family

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2013-11-02 00:21:03 -05:00
parent 6a81623690
commit 1ed90c38ab

View File

@ -343,7 +343,43 @@ public class Arrays {
array[i] = value;
}
}
public static void fill(short[] array, short value) {
for (int i=0;i<array.length;i++) {
array[i] = value;
}
}
public static void fill(byte[] array, byte value) {
for (int i=0;i<array.length;i++) {
array[i] = value;
}
}
public static void fill(boolean[] array, boolean value) {
for (int i=0;i<array.length;i++) {
array[i] = value;
}
}
public static void fill(long[] array, long value) {
for (int i=0;i<array.length;i++) {
array[i] = value;
}
}
public static void fill(float[] array, float value) {
for (int i=0;i<array.length;i++) {
array[i] = value;
}
}
public static void fill(double[] array, double value) {
for (int i=0;i<array.length;i++) {
array[i] = value;
}
}
public static <T> void fill(T[] array, T value) {
for (int i=0;i<array.length;i++) {
array[i] = value;