meta.class - meta.class class describes MATLAB® classes

Description

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 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 Saving and Loading Objects

ContainingPackage read onlyA meta.package object describing the package within which this class is contained, or an empty object if this class is not in a package.
Description read onlyCurrently not used
DetailedDescription read onlyCurrently not used
Events read onlyA cell array of meta.event objects describing each event defined by this class, including all inherited events.
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 onlyA cell array of meta.method objects describing each method defined by this class, including all inherited public and protected methods.
Name read onlyName of the class associated with this meta.class object (char array)
Properties read onlyA cell array of meta.property objects describing each property defined by this class, including all inherited public and protected properties.
Sealed attribute, default = false

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

SuperClasses read onlyA cell array of meta.class objects describing each base class from which this class is derived.

Methods

MethodPurpose
fevalStaticEvaluate a static method given the name of the static method and its argument list.
fromNameReturns the meta.class object associated with the specified class name.
getConstantReturns the value of the specified constant property.
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, fevalStatic, getConstant, fromName, meta.property, meta.method, meta.event, meta.package

  


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