打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Property Attributes
On this page…
Property Attribute Syntax
Table of Property Attributes
Property Attribute Syntax
Assign property attributes on the same line as the properties keyword:
properties (Attribute1 = value1, Attribute2 = value2,...) ...endFor more information on attribute syntax, see Specifying Attributes.
Table of Property Attributes
Attributes enable you to modify the behavior of properties. All properties support the attributes listed in the following table.
Attribute values apply to all properties defined within the properties...end code block that specifies the nondefault values.
Attribute Name
Class
Description
AbortSet
logical
default = false
If true, MATLAB? does not set the property value if the new value is the same as the current value and does not call the property set method, if one exists.
For handle classes, setting AbortSet to true also prevent the triggering of property PreSet and PostSetevents.
See Aborting Set When Value Does Not Change
Abstract
logical
default = false
If true, the property has no implementation, but a concrete subclass must redefine this property without Abstractbeing set to true.Abstract properties cannot define set or get access methods. See Property Access Methods.
Abstract properties cannot define initial values. SeeAssigning a Default Value.
All subclasses must specify the same values as the superclass for the property SetAccess and GetAccessattributes.
Abstract=true use with the class attributeSealed=false (the default).
Access
enumeration, default = public
meta.class object
cell array of meta.class objects
public – unrestricted access
protected – access from class or subclasses
private – access by class members only (not subclasses)
List of classes that have get and set access to this property. 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.
See Controlling Access to Class Members
Use Access to set both SetAccess and GetAccess to the same value. Query the values of SetAccess andGetAccess directly (not Access).
Constant
logical
default = false
Set to true if you want only one value for this property in all instances of the class:
Subclasses inherit constant properties, but cannot change them.
Constant properties cannot be Dependent.
SetAccess is ignored.
See Properties with Constant Values for more information.
Dependent
logical
default = false
If false, property value is stored in object. If true, property value is not stored in object. The set and get functions cannot access the property by indexing into the object using the property name.
MATLAB does not display in the command window the names and values of Dependent properties that do not define a get method (scalar object display only).
Using a Dependent Property
Property Get Methods
Avoiding Property Initialization Order Dependency
GetAccess
enumeration
default = public
public — unrestricted access
protected — access from class or subclasses
private — access by class members only (not from subclasses)
List classes that have get access to this property. 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.
See Controlling Access to Class Members
MATLAB does not display in the command window the names and values of properties having protected orprivate GetAccess or properties whose Hidden attribute is true.
The struct function defines fields for all properties when converting objects to structs.
GetObservable
logical
default = false
If true, and it is a handle class property, then you can create listeners for access to this property. The listeners are called whenever property values are queried. SeeProperty-Set and Query Events
Hidden
logical
default = false
Determines whether the property should be shown in a property list (e.g., Property Inspector, call to set or get, etc.).
MATLAB does not display in the command window the names and values of properties whose Hidden attribute istrue or properties having protected or privateGetAccess.
SetAccess
enumeration
default = public
public — unrestricted access
protected — access from class or subclasses
private — access by class members only (not from subclasses)
immutable — property can be set only in the constructor.
See Mutable and Immutable Properties
List classes that have set access to this property. 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.
See Controlling Access to Class Members
SetObservable
logical
default = false
If true, and it is a handle class property, then you can create listeners for access to this property. The listeners are called whenever property values are modified. SeeProperty-Set and Query Events
Transient
logical
default = false
If true, property value is not saved when object is saved to a file. See Understanding the Save and Load Process for more about saving objects.
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
动态可订制属性的 PropertyGrid
配置Spring+hibernate使用ehcache作为second-level cache
三种流行的连接池配置
spring中整合c3p0的配置
The database returned no natively generated identity value
Alfresco支持LDAP验证
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服