view m-toolbox/m/helper/keys.m @ 3:960fe1aa1c10 database-connection-manager

Add LTPDADatabaseConnectionManager implementation. Java code
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

function varargout = keys(varargin)
  
  className = varargin{1};
  if nargin > 1
    methodName = varargin{2}
  else
    methodName = className;
  end
  
  cmd = sprintf('%s.getInfo(''%s'')', className, methodName);
  ii = eval(cmd);
  
  out = '';
  for kk=1:numel(ii.sets)
    set = ii.sets{kk};
    out = [out repmat('-', 1, length(set))];
    out = [out sprintf('\n')];
    out = [out sprintf('%s\n', set)];
    out = [out repmat('-', 1, length(set))];
    out = [out sprintf('\n')];
    
    pl = ii.plists(kk);
    keys = pl.getKeys();
    keyLine = '';
    for ll=1:numel(keys)
      key = keys{ll};
      keyLine = [keyLine key];
      if length(keyLine)>100
        keyLine = [keyLine sprintf('\n')];
        out = [out keyLine];
        keyLine = '';
      else
        if ll < numel(keys)
          keyLine = [keyLine ', '];
        end
      end
    end
    out = [out keyLine sprintf('\n\n')];
    
  end
  
  disp(out);
  
  if nargout > 0
    varargout{1} = out;
  end
  
end