MatrixBerryCore
HandleObjectCloner.m
Go to the documentation of this file.
1 classdef HandleObjectCloner<mxberry.core.obj.HandleObjectCloner
2  properties
3  alpha
4  end
5  methods
6  function self=HandleObjectCloner(alpha)
7  if nargin>0
8  self.alpha=alpha;
9  end
10  end
11  end
12  methods (Access=protected)
13  function blobComparisonHook(~)
14  mxberry.core.test.aux.EqualCallCounter.incEqCounter(1);
15  end
16  function [isOk,reportStr,signOfDiff]=isEqualScalarInternal(self,otherObj,varargin)
17  reportStr='';
18  if nargout>2
19  signOfDiff=nan;
20  end
21  isOk=isequal(self.alpha,otherObj.alpha);
22  if ~isOk
23  reportStr='alpha is different';
24  end
25  mxberry.core.test.aux.EqualCallCounter.incEqCounter(1);
26  end
27  end
28  methods
29  function self=disp(self)
30  S.alpha=arrayfun(@(x)x.alpha,self);
31  mxberry.core.struct.strucdisp(S);
32  end
33  end
34  methods (Static)
35  function objVec=create(nObj)
36  for iObj=nObj:-1:1
37  objVec(iObj)=...
38  mxberry.core.obj.test.HandleObjectCloner(iObj);
39  end
40  end
41  end
42 end
function strucdisp(in varargin)
STRUCDISP display structure outline.
HANDLEOBJECTCLONER provides some simple functionality for clonable objects.