1 classdef MapAutoKey<handle
2 properties(Constant,GetAccess=
private)
3 MAX_VALUE=intmax('uint64');
5 properties (Access=private)
12 properties (Dependent,SetAccess=private,GetAccess=public)
16 function nKeys=get.Count(self)
17 nKeys=self.plainMap.Count;
19 function fullKey=getDirectKey(self,keyStr)
20 fullKey=[self.directPrefix,keyStr];
22 function isPos=isKey(self,keyStr)
23 isPos=self.plainMap.isKey(keyStr);
25 function remove(self,keyList)
26 self.plainMap.remove(keyList);
28 function value=get(self,keyStr)
29 value=self.plainMap(keyStr);
31 function valueList=values(self)
32 valueList=self.plainMap.values;
34 function keyList=keys(self)
35 keyList=self.plainMap.keys;
38 [restArgList,~,self.directPrefix,self.autoPrefix]=...
40 {
'directPrefix',
'autoPrefix';
42 'isstring(x)',
'isstring(x)'});
44 self.plainMap=containers.Map(restArgList{:});
46 function putDirect(
self,keyStr,value)
47 self.plainMap(
self.getDirectKey(keyStr))=value;
49 function put(
self,keyStr,value)
50 self.plainMap(keyStr)=value;
52 function keyStr=putAuto(
self,value)
53 if self.curCounter==
self.MAX_VALUE
54 self.curPrefix=[
self.curPrefix,
'0'];
57 self.curCounter=
self.curCounter+1;
58 keyStr=sprintf(
'%s%s%u',
self.autoPrefix,
self.curPrefix,
self.curCounter);
59 self.plainMap(keyStr)=value;
function parseparext(in args, in propNameValMat, in varargin)
PARSEPAREXT behaves in the same way as mxberry.core.parseparams but returns property values in a more...