Mercurial > hg > ltpda
view 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 |
line wrap: on
line source
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html lang="en"> <head> <meta name="generator" content= "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org"> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii"> <title>Collection objects (LTPDA Toolbox)</title> <link rel="stylesheet" href="docstyle.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.52.2"> <meta name="description" content= "Presents an overview of the features, system requirements, and starting the toolbox."> </head> <body> <a name="top_of_page" id="top_of_page"></a> <p style="font-size:1px;"> </p> <table class="nav" summary="Navigation aid" border="0" width= "100%" cellpadding="0" cellspacing="0"> <tr> <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td> <td valign="baseline" align="right"><a href= "ao_plot.html"><img src="b_prev.gif" border="0" align= "bottom" alt="Plotting Analysis Objects"></a> <a href= "ltpda_units.html"><img src="b_next.gif" border="0" align= "bottom" alt="Units in LTPDA"></a></td> </tr> </table> <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Collection objects</h1> <hr> <p> <p> Collection objects serve as merely a wrapper for a cell-array of LTPDA User Objects. The point of this is to provide a way to put together user objects of different classes in to a collection which can be saved/loaded/submitted/retrieved, etc. </p> <p> You can create a <tt>collection</tt> object like: <div class="fragment"><pre> >> c = collection ---- collection 1 ---- name: none num objs: 0 description: UUID: a339a156-956b-4657-96ef-9ea4feef8101 ---------------------- </pre></div> You can then add objects to the collection by doing: <div class="fragment"><pre> >> c.addObjects(ao(1)) M: running ao/ao M: constructing from values M: running collection/addObjects M: running ao/char ---- collection 1 ---- name: none num objs: 1 01: ao | None/cdata(Ndata=[1x1]) description: UUID: c1f0200f-ad98-4fd6-beae-2dcdabb33515 ---------------------- </pre></div> or <div class="fragment"><pre> >> c.addObjects(pzmodel(1, 10, 100), mfir()) M: running collection/addObjects M: running ao/char ---- collection 1 ---- name: none num objs: 3 01: ao | None/cdata(Ndata=[1x1]) 02: pzmodel | pzmodel(None) 03: mfir | none(fs=, ntaps=0.00, a=[]) description: UUID: e7f02380-5650-4788-b819-f7fa7ee50a7d ---------------------- </pre></div> </p> <p> You can then extract objects from the collection using <tt>getObjectAtIndex</tt> or get an array of all objects of a particular class using <tt>getObjectsOfClass</tt>. Objects can be removed from the collection using <tt>removeObjectAtIndex</tt>. </p> <p> Since a <tt>collection</tt> object is an LTPDA User Object, it has history tracking capabilities. That means that everytime you add or remove an object to/from the collection, a history step is added. For example, the history of our collection above looks like: <img src="images/collection_history.png" alt="Collection history" border="3"> </p> </p> <br> <br> <table class="nav" summary="Navigation aid" border="0" width= "100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td align="left" width="20"><a href="ao_plot.html"><img src= "b_prev.gif" border="0" align="bottom" alt= "Plotting Analysis Objects"></a> </td> <td align="left">Plotting Analysis Objects</td> <td> </td> <td align="right">Units in LTPDA</td> <td align="right" width="20"><a href= "ltpda_units.html"><img src="b_next.gif" border="0" align= "bottom" alt="Units in LTPDA"></a></td> </tr> </table><br> <p class="copy">©LTP Team</p> </body> </html>