Home > classes > @plist > isparam.m

isparam

PURPOSE ^

ISPARAM look for a given key in the parameter list.

SYNOPSIS ^

function res = isparam(pl, key)

DESCRIPTION ^

 ISPARAM look for a given key in the parameter list.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: ISPARAM look for a given key in the parameter list. Exist the key
              in the parameter list then is the result 1 otherwise 0.

 CALL:        res = isparam(pl, 'key')

 VERSION:     $Id: isparam.m,v 1.3 2008/02/14 08:29:09 mauro Exp $

 HISTORY:     07-11-2007 Diepholz
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function res = isparam(pl, key)
0002 % ISPARAM look for a given key in the parameter list.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: ISPARAM look for a given key in the parameter list. Exist the key
0007 %              in the parameter list then is the result 1 otherwise 0.
0008 %
0009 % CALL:        res = isparam(pl, 'key')
0010 %
0011 % VERSION:     $Id: isparam.m,v 1.3 2008/02/14 08:29:09 mauro Exp $
0012 %
0013 % HISTORY:     07-11-2007 Diepholz
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION = '$Id: isparam.m,v 1.3 2008/02/14 08:29:09 mauro Exp $';
0019 CATEGORY = 'Helper';
0020 
0021 % Check if this is a call for parameters or for the cvs-version number
0022 if nargin == 2
0023   if isa(pl, 'plist') && ischar(key)
0024     in = key;
0025     if strcmp(in, 'Params')
0026       res = plist();
0027       return
0028     elseif strcmp(in, 'Version')
0029       res = VERSION;
0030       return
0031     elseif strcmp(in, 'Category')
0032       res = CATEGORY;
0033       return
0034     end
0035   end
0036 end
0037 
0038 p   = pl.params;
0039 res = 0;
0040 
0041 for ii = 1:length(p)
0042   if strcmpi(p(ii).key, key)
0043     res = 1;
0044     return
0045   end
0046 end
0047 
0048 
0049 
0050 % END

Generated on Mon 31-Mar-2008 13:54:54 by m2html © 2003