MATLAB BUILDER JA 2 Guide de l'utilisateur Page 210

  • 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 209
4 Using MWArra y Classes
Example Cloning a Structure Array Object
Create an MWStructArray object and then a clone of that object:
int[] sdims = {1, 2};
String[] sfields = {"f1", "f2", "f3"};
MWStructArray S = new MWStructArray(sdims, sfields);
Object C = S.clone();
System.out.println("Clone of structure S is:");
System.out.println(C.toString());
When run, the example displays this output:
Clone of structure S is:
1x2 struct array with fields:
f1
f2
f3
compareTo. MWStructArray inherits this method from the MWArray class.
equals.
MWStructArray inherits this method from the MWArray class.
hashCode.
MWStructArray inherits this method from the MWArray class.
sharedCopy. This method creates and returns a shared copy of the
MWStructArray object. The shared copy points to the underlying original
MATLAB array. Any changes made to the copy are reflected in the original.
The
sharedCopy method of MWStructArray overrides the sharedCopy method
of class
MWArray.
The prototype for the
sharedCopy method is
public Object sharedCopy()
4-134
Vue de la page 209
1 2 ... 205 206 207 208 209 210 211 212 213 214 215 ... 291 292

Commentaires sur ces manuels

Pas de commentaire