I read a matrix from a file and all column have a different data type. I can't find a structure to hold and manipulate my data. Thank's for help.
// I read a matrix from file and all column have a different type.
int[] iT = new int[] {1,3,5};
long[] lT = new long[] {123, 456, 789};
double[] dT = new double[] {1.2d, 3.2d, 5.2d};
// I like to know if there are a kind of structure to hold and manipulate it.
Collection<Object[]> collection = new HashSet<Object[]>();
collection.add(iT);
collection.add(dT);
collection.add(lT);
for(Object[] obj : collection) {
String type = obj.getClass().getSimpleName();
switch (type) {
case "double[]":
for(Object element : obj) System.out.println(element);
break;
case "int[]":
for(Object element : obj) System.out.println(element);
break;
case "long[]":
for(Object element : obj) System.out.println(element);
break;
}
}