Skip to content

Commit 587624e

Browse files
committed
Rename types enumeration base
1 parent 32ed782 commit 587624e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

code/internal/+openminds/+abstract/TypesEnumeration.m renamed to code/internal/+openminds/+base/TypesEnumerationBase.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@
1515
end
1616

1717
methods
18+
function instance = create(obj)
19+
% create - Create a new instance (same as createInstance)
20+
instance = obj.createInstance();
21+
end
22+
23+
function instance = createInstance(obj)
24+
% createInstance - Create a new instance
25+
if numel(obj) == 1
26+
instance = feval(obj.ClassName);
27+
else
28+
error('Can not create instances for list of types')
29+
end
30+
end
31+
1832
function tf = ismissing(obj)
1933
tf = strcmp(obj.ClassName, 'None');
2034
end

0 commit comments

Comments
 (0)