Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/collection_objects.html @ 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 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> | |
3 | |
4 <html lang="en"> | |
5 <head> | |
6 <meta name="generator" content= | |
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org"> | |
8 <meta http-equiv="Content-Type" content= | |
9 "text/html; charset=us-ascii"> | |
10 | |
11 <title>Collection objects (LTPDA Toolbox)</title> | |
12 <link rel="stylesheet" href="docstyle.css" type="text/css"> | |
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2"> | |
14 <meta name="description" content= | |
15 "Presents an overview of the features, system requirements, and starting the toolbox."> | |
16 </head> | |
17 | |
18 <body> | |
19 <a name="top_of_page" id="top_of_page"></a> | |
20 | |
21 <p style="font-size:1px;"> </p> | |
22 | |
23 <table class="nav" summary="Navigation aid" border="0" width= | |
24 "100%" cellpadding="0" cellspacing="0"> | |
25 <tr> | |
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td> | |
27 | |
28 <td valign="baseline" align="right"><a href= | |
29 "ao_plot.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="Plotting Analysis Objects"></a> <a href= | |
31 "ltpda_units.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Units in LTPDA"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Collection objects</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 <p> | |
41 Collection objects serve as merely a wrapper for a cell-array of LTPDA User Objects. The point of this is to provide | |
42 a way to put together user objects of different classes in to a collection which can be saved/loaded/submitted/retrieved, etc. | |
43 </p> | |
44 <p> | |
45 You can create a <tt>collection</tt> object like: | |
46 <div class="fragment"><pre> | |
47 >> c = collection | |
48 ---- collection 1 ---- | |
49 name: none | |
50 num objs: 0 | |
51 description: | |
52 UUID: a339a156-956b-4657-96ef-9ea4feef8101 | |
53 ---------------------- | |
54 | |
55 </pre></div> | |
56 You can then add objects to the collection by doing: | |
57 <div class="fragment"><pre> | |
58 >> c.addObjects(ao(1)) | |
59 M: running ao/ao | |
60 M: constructing from values | |
61 M: running collection/addObjects | |
62 M: running ao/char | |
63 ---- collection 1 ---- | |
64 name: none | |
65 num objs: 1 | |
66 01: ao | None/cdata(Ndata=[1x1]) | |
67 description: | |
68 UUID: c1f0200f-ad98-4fd6-beae-2dcdabb33515 | |
69 ---------------------- | |
70 | |
71 </pre></div> | |
72 or | |
73 <div class="fragment"><pre> | |
74 >> c.addObjects(pzmodel(1, 10, 100), mfir()) | |
75 M: running collection/addObjects | |
76 M: running ao/char | |
77 ---- collection 1 ---- | |
78 name: none | |
79 num objs: 3 | |
80 01: ao | None/cdata(Ndata=[1x1]) | |
81 02: pzmodel | pzmodel(None) | |
82 03: mfir | none(fs=, ntaps=0.00, a=[]) | |
83 description: | |
84 UUID: e7f02380-5650-4788-b819-f7fa7ee50a7d | |
85 ---------------------- | |
86 | |
87 </pre></div> | |
88 </p> | |
89 <p> | |
90 You can then extract objects from the collection using <tt>getObjectAtIndex</tt> or get an array of all | |
91 objects of a particular class using <tt>getObjectsOfClass</tt>. Objects can be removed from the collection using | |
92 <tt>removeObjectAtIndex</tt>. | |
93 </p> | |
94 <p> | |
95 Since a <tt>collection</tt> object is an LTPDA User Object, it has history tracking capabilities. That means that everytime you | |
96 add or remove an object to/from the collection, a history step is added. For example, the history of our collection above looks like: | |
97 <img src="images/collection_history.png" alt="Collection history" border="3"> | |
98 </p> | |
99 </p> | |
100 | |
101 <br> | |
102 <br> | |
103 <table class="nav" summary="Navigation aid" border="0" width= | |
104 "100%" cellpadding="0" cellspacing="0"> | |
105 <tr valign="top"> | |
106 <td align="left" width="20"><a href="ao_plot.html"><img src= | |
107 "b_prev.gif" border="0" align="bottom" alt= | |
108 "Plotting Analysis Objects"></a> </td> | |
109 | |
110 <td align="left">Plotting Analysis Objects</td> | |
111 | |
112 <td> </td> | |
113 | |
114 <td align="right">Units in LTPDA</td> | |
115 | |
116 <td align="right" width="20"><a href= | |
117 "ltpda_units.html"><img src="b_next.gif" border="0" align= | |
118 "bottom" alt="Units in LTPDA"></a></td> | |
119 </tr> | |
120 </table><br> | |
121 | |
122 <p class="copy">©LTP Team</p> | |
123 </body> | |
124 </html> |