Mercurial > hg > ltpda
comparison m-toolbox/classes/@plist/getKeys.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % GETKEYS Return all the keys of the parameter list. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: GETKEYS Return all the keys of the parameter list. | |
5 % | |
6 % CALL: cell-array = obj.getKeys(); | |
7 % cell-array = getKeys(obj); | |
8 % | |
9 % INPUTS: obj - input parameter list. | |
10 % | |
11 % <a href="matlab:utils.helper.displayMethodInfo('plist', 'getKeys')">Parameters Description</a> | |
12 % | |
13 % VERSION: $Id: getKeys.m,v 1.8 2011/04/08 08:56:21 hewitson Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 | |
17 function varargout = getKeys(varargin) | |
18 | |
19 %%% Check if this is a call for parameters | |
20 if utils.helper.isinfocall(varargin{:}) | |
21 varargout{1} = getInfo(varargin{3}); | |
22 return | |
23 end | |
24 | |
25 if nargin ~= 1 && numel(varargin{1}) ~= 1 | |
26 error('### This method works only with one parameter list.'); | |
27 end | |
28 | |
29 % Single output | |
30 if isempty(varargin{1}.params) | |
31 varargout{1} = {}; | |
32 else | |
33 varargout{1} = {varargin{1}.params(:).key}; | |
34 end | |
35 end | |
36 | |
37 | |
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
39 % Local Functions % | |
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
41 | |
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
43 % | |
44 % FUNCTION: getInfo | |
45 % | |
46 % DESCRIPTION: Get Info Object | |
47 % | |
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
49 | |
50 function ii = getInfo(varargin) | |
51 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
52 sets = {}; | |
53 pl = []; | |
54 else | |
55 sets = {'Default'}; | |
56 pl = getDefaultPlist; | |
57 end | |
58 % Build info object | |
59 ii = minfo(mfilename, 'plist', 'ltpda', utils.const.categories.helper, '$Id: getKeys.m,v 1.8 2011/04/08 08:56:21 hewitson Exp $', sets, pl); | |
60 end | |
61 | |
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
63 % | |
64 % FUNCTION: getDefaultPlist | |
65 % | |
66 % DESCRIPTION: Get Default Plist | |
67 % | |
68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
69 | |
70 function plo = getDefaultPlist() | |
71 plo = plist(); | |
72 end | |
73 |