This is a static copy of a profile report

Home

opaque.double (358 calls, 0.010 sec)
Generated 18-Mar-2011 23:32:56 using cpu time.
M-function in file /Applications/MATLAB_R2010a.app/toolbox/matlab/datatypes/@opaque/double.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
scribe.legend.legendM-function16
scribe.legend.methods>getsizeinfoM-subfunction22
scribe.legend.methods>strsizeM-subfunction77
...be.legend.methods>create_legend_itemsM-subfunction28
scribe.legend.initM-function22
...nd.methods>create_plotchild_listenersM-subfunction7
scribe/private/updateLegendMenuToolbarM-function2
legendcolorbarlayout>localValidateListsM-subfunction60
legendcolorbarlayout>validateTextObjectsM-subfunction20
scribe.legend.init>computePosM-subfunction28
scribe.legend.init>changedPosM-subfunction2
scribe.legend.methods>update_userdataM-subfunction16
legend>make_legendM-subfunction2
legendcolorbarlayout>doPixelBoundsCBM-subfunction4
legendcolorbarlayout>doParentResizeM-subfunction4
legendcolorbarlayout>doLayoutCBM-subfunction48
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
14
return;
3580 s0%
13
dbl = builtin('double', opaque...
3580 s0%
12
if ~isjava(opaque_array)
3580 s0%
All other lines  0.010 s100.0%
Totals  0.010 s100% 
Children (called functions)
No children
M-Lint results
Line numberMessage
38Best practice is for CATCH to be followed by an identifier that gets the error information.
Coverage results
[ Show coverage for parent directory ]
Total lines in function90
Non-code lines (comments, blank lines)34
Code lines (lines that can run)56
Code lines that did run3
Code lines that did not run53
Coverage (did run/can run)5.36 %
Function listing
   time   calls  line
1 function dbl = double(opaque_array)
2 %DOUBLE Convert a Java object to DOUBLE
3
4 % Chip Nylander, June 1998
5 % Copyright 1984-2007 The MathWorks, Inc.
6 % $Revision: 1.9.4.5 $ $Date: 2007/12/06 13:29:42 $
7
8 %
9 % For opaque types other than those programmed here, just run the default
10 % builtin double function.
11 %
358 12 if ~isjava(opaque_array)
358 13 dbl = builtin('double', opaque_array);
358 14 return;
15 end
16
17 %
18 % Convert opaque array to cell array to get the items in it.
19 %
20
21 try
22 cel = cell(opaque_array);
23 catch exception %#ok
24 dbl = [];
25 return;
26 end
27
28
29 sz = builtin('size', cel);
30 psz = prod(sz);
31
32 %
33 % An empty Java array becomes an empty double array.
34 %
35 if psz == 0
36 try
37 dbl = reshape([],size(cel));
38 catch
39 dbl = [];
40 end
41 return;
42 end;
43
44 %
45 % A java.lang.Number array becomes a double array.
46 %
47 dbl = zeros(sz);
48 t = opaque_array(1);
49 c = class(t);
50
51 while ~isempty(findstr(c,'[]'))
52 t = t(1);
53 c = class(t);
54 end
55
56 if psz == 1 && isnumeric(t)
57 dbl = double(t);
58 return;
59 end
60
61 if isa(t,'java.lang.Number')
62 for i=1:psz
63 if isa(cel{i}, 'java.lang.Object')
64 dbl(i) = doubleValue(cel{i});
65 else
66 dbl(i) = cel{i};
67 end
68 end
69 return;
70 end
71
72 %
73 % Run toDouble on each Java object in the MATLAB array. This will error
74 % out if a toDouble method is not available for the Java class of the object.
75 %
76 if psz == 1
77 if ~isjava(opaque_array(1))
78 dbl = builtin('double', opaque_array(1));
79 else
80 dbl = toDouble(opaque_array(1));
81 end
82 else
83 for i = 1:psz
84 if ~isjava(cel{i})
85 dbl(i) = toDouble(cel{i});
86 else
87 dbl(i) = toDouble(cel{i});
88 end;
89 end;
90 end;