Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
08.doc
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
392.7 Кб
Скачать

Описание атрибутов методов

Название

Тип

Описание

Abstract

logical Default = false

If true, the method has no implementation. The method has a syntax line that can include arguments, which subclasses use when implementing the method:

  • Subclasses are not required to define the same number of input and output arguments. However, subclasses generally use the same signature when implementing their version of the method.

  • The method can have comments after the function line.

  • The method does not contain function or end keywords, only the function syntax (e.g., [a,b] = myMethod(x,y))

Access

  • enumeration, default = public

  • meta.class object

  • cell array of meta.class objects

Determines what code can call this method:

  • public — Unrestricted access

  • protected — Access from methods in class or subclasses

  • private — Access by class methods only (not from subclasses)

  • List classes that have access to this method. Specify classes as meta.class objects in the form:

    • A single meta.class object

    • A cell array of meta.class objects. An empty cell array, {}, is the same as private access.

Hidden

logical Default = false

When false, the method name shows in the list of methods displayed using the methods or methodsview commands. If set to true, the method name is not included in these listings and ismethod does not return true for this method name. .

Sealed

logical Default = false

If true, the method cannot be redefined in a subclass. Attempting to define a method with the same name in a subclass causes an error.

Static

logical Default = false

Specify as true to define a method that does not depend on an object of the class and does not require an object argument. Use the class name to call the method: classname.methodname or an instance of the class: obj.methodname

Таблица 5

Описание атрибутов событий

Название

Тип

Описание

Hidden

logical Default = false

If true, event does not appear in list of events returned by events function (or other event listing functions or viewers).

ListenAccess

  • enumeration, default = public

  • meta.class object

  • cell array of meta.class objects

Determines where you can create listeners for the event.

  • public — Unrestricted access

  • protected — Access from methods in class or subclasses

  • private — Access by class methods only (not from subclasses)

  • List classes that have listen access to this event. Specify classes as meta.class objects in the form:

    • A single meta.class object

    • A cell array of meta.class objects. An empty cell array, {}, is the same as private access.

NotifyAccess

  • enumeration, default = public

  • meta.class object

  • cell array of meta.class objects

Determines where code can trigger the event

  • public — Any code can trigger event

  • protected — Can trigger event from methods in class or derived classes

  • private — Can trigger event by class methods only (not from derived classes)

  • List classes that have notify access to this event. Specify classes as meta.class objects in the form:

    • A single meta.class object

    • A cell array of meta.class objects. An empty cell array, {}, is the same as private access.

25

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]