MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Uživatelský manuál Strana 185

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 408
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 184
Creating and Using Java Objects
5-15
Finding the Public Data Fields of an Object
To list the public fields that belong to a Java object, use the fieldnames
function, which takes either of these forms.
names = fieldnames(obj)
names = fieldnames(obj,'-full')
Calling fieldnames without '-full' returns the names of all the data fields
(including inherited) on the object. With the
'-full' qualifier, fieldnames
returns the full description of the data fields defined for the object, including
type, attributes, and inheritance information.
Suppose, for example, that you constructed a
Frame object with
frame = java.awt.Frame;
To obtain the full description of the data fields on frame, you could use the
command
fieldnames(frame,'-full')
Sample output from this command follows.
ans =
'static final int WIDTH
% Inherited from java.awt.image.ImageObserver'
'static final int HEIGHT
% Inherited from java.awt.image.ImageObserver'
[1x74 char]
'static final int SOMEBITS
% Inherited from java.awt.image.ImageObserver'
'static final int FRAMEBITS
% Inherited from java.awt.image.ImageObserver'
'static final int ALLBITS
% Inherited from java.awt.image.ImageObserver'
'static final int ERROR
% Inherited from java.awt.image.ImageObserver'
'static final int ABORT
% Inherited from java.awt.image.ImageObserver'
'static final float TOP_ALIGNMENT
% Inherited from java.awt.Component'
'static final float CENTER_ALIGNMENT
% Inherited from java.awt.Component'
Zobrazit stránku 184
1 2 ... 180 181 182 183 184 185 186 187 188 189 190 ... 407 408

Komentáře k této Příručce

Žádné komentáře