Programming |
The Asset display Method
The asset display
method is designed to be called from child-class display
methods. Its purpose is to display the data it stores for the child object. The method simply formats the data for display in a way that is consistent with the formatting of the child's display method.
function display(a) % DISPLAY(a) Display an asset object stg = sprintf(... 'Descriptor: %s\nDate: %s\nType: %s\nCurrent Value:%9.2f',... a.descriptor,a.date,a.type,a.currentValue); disp(stg)
The stock class display method can now call this method to display the data stored in the parent class. This approach isolates the stock display
method from changes to the asset class. See The Stock display Method for an example of how this method is called.
The Asset subsasgn Method | The Asset fieldcount Method |
© 1994-2005 The MathWorks, Inc.