Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_uo/setDescription.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 % SETDESCRIPTION sets the 'description' property of a ltpda_uoh object. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: SETDESCRIPTION sets the 'description' property of a ltpda_uoh object. | |
5 % | |
6 % CALL: objs.setDescription(val); | |
7 % objs.setDescription(val1, val2); | |
8 % objs.setDescription(plist('description', val)); | |
9 % objs = objs.setDescription(val); | |
10 % | |
11 % INPUTS: objs: Any shape of ltpda_uoh objects | |
12 % val: | |
13 % 1. Single string e.g. 'val' | |
14 % Each object in objs get this value. | |
15 % 2. Single string in a cell-array e.g. {'val'} | |
16 % Each objects in objs get this value. | |
17 % 3. cell-array with the same number of strings as in objs | |
18 % e.g. {'val1', 'val2', 'val3'} and 3 objects in objs | |
19 % Each object in objs get its corresponding value from the | |
20 % cell-array | |
21 % | |
22 % <a href="matlab:utils.helper.displayMethodInfo('ltpda_uoh', 'setDescription')">Parameters Description</a> | |
23 % | |
24 % VERSION: $Id: setDescription.m,v 1.10 2011/09/16 05:00:38 hewitson Exp $ | |
25 % | |
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
27 | |
28 function varargout = setDescription(varargin) | |
29 | |
30 % Check if this is a call from a class method | |
31 callerIsMethod = utils.helper.callerIsMethod; | |
32 | |
33 if callerIsMethod | |
34 in_names = {}; | |
35 else | |
36 % Collect input variable names | |
37 in_names = cell(size(varargin)); | |
38 for ii = 1:nargin,in_names{ii} = inputname(ii);end | |
39 end | |
40 | |
41 objects = setPropertyValue(... | |
42 varargin{:}, ... | |
43 in_names, ... | |
44 callerIsMethod, ... | |
45 'description', ... | |
46 [], ... | |
47 nargout, ... | |
48 @getInfo); | |
49 | |
50 % set outputs | |
51 varargout = utils.helper.setoutputs(nargout, objects); | |
52 | |
53 end | |
54 | |
55 | |
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
57 % Local Functions % | |
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
59 %-------------------------------------------------------------------------- | |
60 % Get Info Object | |
61 %-------------------------------------------------------------------------- | |
62 function ii = getInfo(varargin) | |
63 | |
64 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
65 sets = {}; | |
66 pl = []; | |
67 else | |
68 sets = {'Default'}; | |
69 pl = getDefaultPlist(); | |
70 end | |
71 % Build info object | |
72 ii = minfo(mfilename, mfilename('class'), 'ltpda', utils.const.categories.helper, '$Id: setDescription.m,v 1.10 2011/09/16 05:00:38 hewitson Exp $', sets, pl); | |
73 end | |
74 | |
75 %-------------------------------------------------------------------------- | |
76 % Get Default Plist | |
77 %-------------------------------------------------------------------------- | |
78 function plout = getDefaultPlist() | |
79 persistent pl; | |
80 if ~exist('pl', 'var') || isempty(pl) | |
81 pl = buildplist(); | |
82 end | |
83 plout = pl; | |
84 end | |
85 | |
86 function pl = buildplist() | |
87 pl = plist({'description', 'The description to set.'}, paramValue.EMPTY_STRING); | |
88 end |