Method Access List
This class declares an access list for the method Access
attribute:
classdef MethodAccess methods (Access = {?ClassA, ?ClassB, ?MethodAccess}) function listMethod(obj) ... end end end
The MethodAccess
class specifies the following method access:
Access to
listMethod
from an instance ofMethodAccess
by methods of the classesClassA
andClassB
.Access to
listMethod
from an instance ofMethodAccess
by methods of subclasses ofMethodAccess
, because of the inclusion ofMethodAccess
in the access list.Subclasses of
ClassA
andClassB
are allowed to define a method namedlistMethod
, andMethodAccess
is allowed to redefinelistMethod
. However, ifMethodAccess
was not in the access list, its subclasses could not redefinelistMethod
.