Programming Previous page   Next Page

Designing the Stock Class

A stock object is designed to represent one particular asset in a person's investment portfolio. This object contains two properties of its own and inherits three properties from its parent asset object.

Stock properties:

Asset properties:

Note that the property names are not actually the same as the field names of the structure array used internally by stock and asset objects. The property name interface is controlled by the stock and asset set and get methods and is designed to resemble the interface of other MATLAB object properties.

The asset field in the stock object structure contains the parent asset object and is used to access the inherited fields in the parent structure.

Stock Class Methods

The stock class implements the following methods:


Previous page  The Asset fieldcount Method The Stock Constructor Method Next page

© 1994-2005 The MathWorks, Inc.