MATLAB Object-Oriented Programming
Method Conflicts If two or more superclasses define methods with the same name, then at least one of the following must be true: ...
Inherited from the unrestricted superclass When using multiple inheritance, ensure that all superclasses remain free of confli ...
Specify Allowed Subclasses In this section... “Basic Knowledge” on page 12-25 “Why Control Allowed Subclasses” on page 12-25 “Sp ...
classdef (AllowedSubclasses = ?ClassName) MySuperClass ... end Use a cell array of meta.class objects to define more than one al ...
Use the meta.class property RestrictsSubclassing to determine if a class is Sealed or specifies AllowedSubclasses. Define Sealed ...
Class Members Access In this section... “Basic Knowledge” on page 12-28 “Applications for Access Control Lists” on page 12-29 “S ...
Possible Values for Access to Class Members The following class member attributes can contain a list of classes: Properties — A ...
Use the class meta.class object to refer to classes in the access list. To specify more than one class, use a cell array of meta ...
Properties with Access Lists These sample classes show the behavior of a property that grants read access (GetAccess) to a class ...
Define their own method with the same name (if not a subclass). Override the method in a subclass only if the superclass defini ...
b.m1; Method m1 defined by AcListNonSub Subclasses Without Access Including the defining class in the access list for a method g ...
Error in AcListSub/sub1 (line 4) AcListSuper_Obj.m1; Indirect Call to Superclass Method You can call a superclass method from a ...
methods function obj = nonSub2(obj,AcListSub_Obj) disp('Call m1 via subclass object:') AcListSub_Obj.m1; end end Calling the non ...
Property Access List This class declares access lists for the property GetAccess and Access attributes: classdef PropertyAccess ...
Method Access List This class declares an access list for the method Access attribute: classdef MethodAccess methods (Access = { ...
Event Access List This class declares an access list for the event ListenAccess attribute: classdef EventAccess events (NotifyAc ...
Handle Compatible Classes In this section... “Basic Knowledge” on page 12-39 “When to Use Handle Compatible Classes” on page 12- ...
nonhandle compatible class as handle-compatible by using the HandleCompatible class attribute. classdef (HandleCompatible) MyCla ...
How to Define Handle-Compatible Classes In this section... “What Is Handle Compatibility?” on page 12-41 “Subclassing Handle-Com ...
The Utility class is handle compatible. Therefore, you can use it in the derivation of classes that are either handle classes or ...
«
22
23
24
25
26
27
28
29
30
31
»
Free download pdf