comparison m-toolbox/classes/@cdata/cdata.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 % CDATA is the constant data class.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: CDATA is the constant data class.
5 %
6 % SUPER CLASSES: ltpda_data
7 %
8 % VERSION: $Id: cdata.m,v 1.70 2011/04/01 08:44:56 hewitson Exp $
9 %
10 % SEE ALSO: ltpda_obj, ao, miir, mfir, specwin, timespan, pzmodel, history, ssm
11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
14 classdef (Hidden = true) cdata < ltpda_data
15
16
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18 % Property definition %
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20
21 %---------- Public (read/write) Properties ----------
22 properties
23 end
24
25 %---------- Protected read-only Properties ----------
26 properties (GetAccess = public, SetAccess = protected)
27 end
28
29 %---------- Private Properties ----------
30 properties (GetAccess = protected, SetAccess = protected)
31 end
32
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 % Check property setting %
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36
37 methods
38 end
39
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41 % Constructor %
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
44 methods
45 function obj = cdata(varargin)
46
47 switch nargin
48 case 0
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 %%%%%%%%%%%%%%%%%%%%%%%%%%% no inputs %%%%%%%%%%%%%%%%%%%%%%%%%%%
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52
53 case 1
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 %%%%%%%%%%%%%%%%%%%%%%%%%%% one input %%%%%%%%%%%%%%%%%%%%%%%%%%%
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
58 if isa(varargin{1}, 'cdata')
59 %%%%%%%%%% Copy ltpda_obj Object %%%%%%%%%%
60 %%%%%%%%%% data = cdata(cdata-object) %%%%%%%%%%
61 obj = copy(varargin{1}, 1);
62
63 elseif isstruct(varargin{1})
64 %%%%%%%%%% data = cdata(struct) %%%%%%%%%%
65 obj = fromStruct(obj, varargin{1});
66
67 elseif isnumeric(varargin{1}) || islogical(varargin{1})
68 %%%%%%%%%% data = cdata(data- vector, matrix) %%%%%%%%%%
69 obj = obj.setY(varargin{1});
70 else
71 error('### Unknown single argument constructor.');
72 end
73
74 case 2
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76 %%%%%%%%%%%%%%%%%%%%%%%%%%% two input %%%%%%%%%%%%%%%%%%%%%%%%%%%
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78
79 if isa(varargin{1}, 'org.apache.xerces.dom.DeferredElementImpl') && ...
80 isa(varargin{2}, 'history')
81 %%%%%%%%%% obj = cdata(DOM node, history-objects) %%%%%%%%%%
82 obj = fromDom(obj, varargin{1}, varargin{2});
83
84 else
85 error('### Unknown constructor method for two inputs.');
86 end
87
88 otherwise
89 error('### Unknown number of arguments.');
90 end
91
92 end % End constructor
93
94 end
95
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
97 % Methods (public) %
98 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99
100 methods
101 varargout = char(varargin)
102 varargout = copy(varargin)
103 end
104
105 methods (Hidden = true)
106 varargout = attachToDom(varargin)
107 end
108
109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110 % Methods (protected) %
111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112
113 methods (Access = protected)
114 varargout = fromStruct(varargin)
115 varargout = fromDom(varargin)
116 end
117
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
119 % Methods (private) %
120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121
122 methods (Access = private)
123 end
124
125 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126 % Methods (static) %
127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128
129 methods (Static)
130
131 function out = VEROUT()
132 out = '$Id: cdata.m,v 1.70 2011/04/01 08:44:56 hewitson Exp $';
133 end
134
135 function ii = getInfo(varargin)
136 ii = utils.helper.generic_getInfo(varargin{:}, 'cdata');
137 end
138
139 function out = SETS()
140 out = {'Default'};
141 end
142
143 function out = getDefaultPlist(set)
144 switch lower(set)
145 case 'default'
146 out = plist();
147 otherwise
148 error('### Unknown set [%s]', set');
149 end
150 end
151
152 function obj = initObjectWithSize(n,m)
153 obj = cdata.newarray([n m]);
154 end
155
156 end
157
158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159 % Methods (static, hidden) %
160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161
162 methods (Static = true, Hidden = true)
163 varargout = loadobj(varargin)
164 varargout = update_struct(varargin);
165 end
166
167 end
168