Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

meta.class - meta.class class describes MATLAB classes

Description

Instances of the meta.class class contains information about MATLAB classes. The read/write properties of the meta.class class correspond to class attributes and are set only from within class definitions on the classdef line. You can query the read–only properties of the meta.class object to obtain information that is specified syntactically by the class (for example, to obtain the name of the class).

You cannot instantiate a meta.class object directly. You can construct a meta.class object from an instance of a class or using the class name:

For example, the metaclass function returns the meta.class object representing myclass.

ob = myclass;
obmeta = metaclass(ob);
obmeta.Name
ans =
myclass

You can use the class name to obtain the meta.class object:

obmeta = ?myclass;

You can also use the fromName static method:

obmeta = meta.class.fromName('myclass');

Properties

PropertyPurpose
ConstructOnLoad attribute, default = false

If true, the class constructor is called automatically when loading an object from a MAT-file. Therefore, the construction must be implemented so that calling it with no arguments does not produce an error.

See Tips for Saving and Loading

ContainingPackage read only

A meta.package object describing the package within which this class is contained, or an empty object if this class is not in a package.

See Scoping Classes with Packages.

Description read onlyCurrently not used
DetailedDescription read onlyCurrently not used
Events read only

A cell array of meta.event objects describing each event defined by this class, including all inherited events.

See Events — Sending and Responding to Messages .

Hidden attribute, default = falseIf set to true, the class does not appear in the output of MATLAB commands or tools that display class names.
InferiorClasses attribute, default = {}

A cell array of meta.class objects defining the precedence of classes represented by the list as inferior to this class.

See Specifying Class Precedence

Methods read only

A cell array of meta.method objects describing each method defined by this class, including all inherited public and protected methods.

See Class Methods.

Name read onlyName of the class associated with this meta.class object (char array)
Properties read only

A cell array of meta.property objects describing each property defined by this class, including all inherited public and protected properties.

See Properties — Storing Class Data.

Sealed attribute, default = false

If true, the class can be not be specialized with subclasses.

SuperClasses read only

A cell array of meta.class objects describing each superclass from which this class is derived.

See Creating Subclasses — Syntax and Techniques.

Methods

MethodPurpose
fromNameReturns the meta.class object associated with the specified class name.
tf = eq(cls)Equality function (a == b). Use to test if two variables refer to equal classed (classes that contain exactly the same list of elements).
tf = ne(cls)Not equal function (a ~= b). Use to test if two variables refer to different meta–classes.
tf = lt(clsa,clsb)Less than function (clsa < clsb). Use to determine if clsa is a strict subclass of clsb (i.e., clsb < clsb is false).
tf = le(clsa,clsb)Less than or equal to function (clsa <= clsb). Use to determine if clsa is a subclass of clsb.
tf = gt(clsa,clsb)Greater than function (clsb > clsa). Use to determine if clsb is a strict superclass of clsa (i.e., clsb > clsb is false).
tf = ge(clsa,clsb)Greater than or equal to function (clsb >= clsa). Use to determine if clsb is a superclass of clsa.

See Also

See Obtaining Information About Classes with Meta-Classes, fromName, meta.property, meta.method, meta.event, meta.package

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS