User`s guide

4 Using MWArra y Classes
}
}
finally
{
if (c != null)
c.dispose();
}
}
This method loops through the array and prints the type of each ce ll. The
temporary array returned by
getCell is disposed of after it is used. The
finally clause ensures that the array is disposed of before exiting, in the
case of an exception.
MWCellArray also override s the MWArray.get methods.
In this case, a Java array is returned that represents a conversion of the
underlying cell, as would b e returned by
toArray.
Using get. Yo u can thi nk of
get as being implemented as follows:
Object get(int index)
{
MWArray a = null;
try
{
a = this.getCell(index);
return a.toArray();
}
finally
{
if (a != null)
a.dispose();
}
}
Using get, you can retrieve the cells from the first MWCellArray example
as Java arrays.
int[] index = {1, 1};
String x11 = (String)a.get(index);
4-36