User`s guide

4 Using MWArra y Classes
Input Parameters
None
Example Getting Structure Array Data with toArray
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
Integer[] val = new Integer[25];
for(inti=0;i<6;i++)
val[i] = new Integer(i * 15);
for(inti=0;i<2;i++)
for (int j = 0; j < sfields.length; j++)
S.set(sfields[j], i+1, val[j + (i * 3)]);
Object[][][] x = (Object[][][]) S.toArray();
System.out.println();
System.out.println("Data read from structure array S \n");
for(intj=0;j<2;j++)
for (int i = 0; i < x.length; i++)
System.out.print(" " + ((int[][]) x[i][0][j])[0][0]);
When run, the example displays this output:
Data read from structure array S
01530456075
Methods to Copy, Convert, and Compare MWStructArrays
Use these methods to copy, convert, and compare objects of class
MWStructArray.
4-132