Mercurial > hg > ltpda
comparison m-toolbox/classes/@plist/getPropertyForKey.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 % GETPROPERTY get a property from a specified parameter. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: GETPROPERTY get a property from a specified parameter. If | |
5 % the property name exists then it returns the value otherwise | |
6 % an empty array ([]). | |
7 % | |
8 % CALL: obj = obj.getProperty(key, propertyName); | |
9 % | |
10 % INPUTS: key: Key for the parameter | |
11 % propertyName: Property name of the value | |
12 % | |
13 % VERSION: $Id: getPropertyForKey.m,v 1.1 2009/07/14 16:13:20 ingo Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 | |
17 function val = getPropertyForKey(obj, key, propertyName) | |
18 | |
19 if nargin ~= 3 | |
20 error('### This method works only with three inputs.'); | |
21 end | |
22 | |
23 val = []; | |
24 for ii = 1:numel(obj.params) | |
25 if strcmpi(obj.params(ii).key, key) | |
26 val = obj.params(ii).getProperty(propertyName); | |
27 break; | |
28 end | |
29 end | |
30 | |
31 end |