MATLAB Object-Oriented Programming

(Joyce) #1

Method Purpose Default


getFooter Create the text used for the footer. There are two footers:



  • Simple display — Returns an
    empty char vector

  • Detailed display — Returns linked
    calls to methods, events, and
    superclasses for this class


Object States That Affect Display

There are four object states that affect how MATLAB displays objects:


  • Valid scalar object

  • Nonscalar object array

  • Empty object array

  • Scalar handle to a deleted object


State Handler Methods

Each object state has an associated method that MATLAB calls whenever displaying
objects that are in that particular state.

State Handler Method Called for Object in This State


displayScalarObject (isa(obj,'handle') && isvalid(obj))
&& prod(size(obj)) == 1


displayNonScalarObject prod(size(obj)) > 1


displayEmptyObject prod(size(obj)) == 0


displayScalarHandleToDeletedObject isa(obj,'handle') && isscalar(obj) &&
~isvalid(obj)


Utility Methods

The CustomDisplay class provides utility methods that return strings that are used in
various parts of the different display options. These static methods return text that
simplifies the creation of customized object displays.

If the computer display does not support hypertext linking, the strings are returned
without the links.

Custom Display Interface
Free download pdf