use of org.scijava.util.FloatArray in project imagej-omero by imagej.
the class TableUtils method populateArrayColumn.
// -- Helper methods --
@SuppressWarnings("unchecked")
private static void populateArrayColumn(final DefaultColumn<?> col, final Object[] data) {
if (col.getType().equals(FloatArray.class)) {
for (int i = 0; i < data.length; i++) {
final Float[] f = (Float[]) data[i];
((DefaultColumn<FloatArray>) col).add(i, new FloatArray(ArrayUtils.toPrimitive(f)));
}
} else if (col.getType().equals(LongArray.class)) {
for (int i = 0; i < data.length; i++) {
final Long[] f = (Long[]) data[i];
((DefaultColumn<LongArray>) col).add(i, new LongArray(ArrayUtils.toPrimitive(f)));
}
} else if (col.getType().equals(DoubleArray.class)) {
for (int i = 0; i < data.length; i++) {
final Double[] f = (Double[]) data[i];
((DefaultColumn<DoubleArray>) col).add(i, new DoubleArray(ArrayUtils.toPrimitive(f)));
}
}
}
Aggregations