MATLAB BUILDER JA 2 Guide de l'utilisateur Page 199

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 292
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 198
Using Class Methods
public java.lang.String[] fieldNames()
Input Parameters
None
Example Getting the Field Names of a Structure Array
Create an MWStructArray object with three fields and display the field names:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
String[] str = S.fieldNames();
System.out.print("The structure has the fields: ");
for (int i=0; i<S.numberOfFields(); i++)
System.out.print(" " + str[i]);
When run, the example displays this output:
The structure has the fields: f1 f2 f3
getDimensions. MWStructArray inherits this method from the MWArray
class.
isEmpty.
MWStructArray inherits this method from the MWArray class.
numberOfDimensions.
MWStructArray inherits this method from the
MWArray class.
numberOfElem ents.
MWStructArray inherits this m ethod from the MWArray
class.
numberOfFields. This method returns the number of fields in this array.
The prototype for the
numberOfFields method is
4-123
Vue de la page 198
1 2 ... 194 195 196 197 198 199 200 201 202 203 204 ... 291 292

Commentaires sur ces manuels

Pas de commentaire