MATLAB BUILDER JA 2 Guida Utente Pagina 112

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 292
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 111
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
Vedere la pagina 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 291 292

Commenti su questo manuale

Nessun commento