MATLAB Object-Oriented Programming
Class Introspection with Metadata In this section... “Using Class Metadata” on page 16-5 “Inspect the EmployeeData Class” on pag ...
end end Inspect Class Definition Using the EmployeeData class, create a meta.class object using the? operator: mc = ?EmployeeDat ...
length(mpArray) ans = 2 Now get a meta.property object from the array: prop1 = mpArray(1); prop1.Name ans = EmployeeName The Nam ...
Inspect Class Instance Create an EmployeeData object and determine property access settings: EdObj = EmployeeData('My Name',1234 ...
Query enumeration names from the meta.class object: mc = ?WeekDays; mc.EnumerationMemberList(2).Name ans = Tuesday See Also Rela ...
Find Objects with Specific Values In this section... “Find Handle Objects” on page 16-10 “Find by Attribute Settings” on page 16 ...
NW = findobj(PB,'Name','Nancy Wong'); [NW.Name,' - ',NW.Number] ans = Nancy Wong - 5081234569 Find Objects with Specific Propert ...
Search the MethodList list of meta.method objects for those methods that have their Abstract property set to true: absMethods = ...
ans = 1 findobj returns an array of meta.method objects for the static methods. In this case, the list of static methods is not ...
Get Information About Properties In this section... “The meta.property Object” on page 16-14 “How to Find Properties with Specif ...
DetailedDescription: '' Hidden: 0 Sealed: 0 Abstract: 0 Enumeration: 0 ConstructOnLoad: 0 HandleCompatible: 1 InferiorClasses: { ...
SetAccess: 'public' Dependent: 0 Constant: 0 Abstract: 0 Transient: 0 Hidden: 0 GetObservable: 0 SetObservable: 0 AbortSet: 0 No ...
ans = meta.property Each array element is a single meta.property object: mc.Properties(1) ans = [1x1 meta.property] The Name pro ...
The findAttrValue function returns a cell array of property names that set the specified attribute. The findAttrValue function a ...
end end cl_out = cl_array(1:ii); end Find Property Attributes Suppose that you have the following containers.Map object: mapobj ...
Find Default Values in Property Metadata In this section... “Default Values” on page 16-20 “meta.property Data” on page 16-20 De ...
Name: 'RandNumber' Description: '' DetailedDescription: '' GetAccess: 'public' SetAccess: 'public' Dependent: 0 Constant: 0 Abst ...
(^2) Testing the logical value of the meta.property HasDefault property to determine if the property defines a default value. MA ...
if mp(k).HasDefault dv = mp(k).DefaultValue; end The DefaultValue property is read-only. Changing the default value in the class ...
ans = 0 dv = mp.DefaultValue; No default value has been defined for property Foo Abstract Property MyClass defines the Foo prope ...
«
31
32
33
34
35
36
37
38
39
40
»
Free download pdf