r9709 - apps/reference/trunk/coreEnvironment
[email protected] Tue, 5 May 2009 14:35:02 +0200 (CEST)
| Newsgroups | gmane.comp.java.helma.cvs |
|---|---|
| Message-ID | <20090505123502.A2B4F3D0D6@mia> |
Author: zumbrunn
Date: 2009-05-05 14:35:02 +0200 (Tue, 05 May 2009)
New Revision: 9709
Modified:
apps/reference/trunk/coreEnvironment/HopObject.js
Log:
removed outdated warnings concerning the performance of the HopObject list() method and added proper docs for the startIndex and length parameters
Details at http://dev.helma.org/trac/helma/changeset/9709
Modified: apps/reference/trunk/coreEnvironment/HopObject.js
===================================================================
--- apps/reference/trunk/coreEnvironment/HopObject.js 2009-05-04 22:33:59 UTC (rev 9708)
+++ apps/reference/trunk/coreEnvironment/HopObject.js 2009-05-05 12:35:02 UTC (rev 9709)
@@ -509,15 +509,10 @@
/**
* Returns an array including all subnodes of a HopObject.
* <br /><br />
- * The start and count parameters are optional, if
+ * The startIndex and length parameters are optional, if
* omitted, an array of the entire collection of subnodes
* is returned, otherwise only the specified range.
* <br /><br />
- * This function is most useful if the whole
- * collection of a HopObject's subnodes should be
- * retrieved as array. However, general use should be
- * avoided in favor of the method described below.
- * <br /><br />
* Example:
* <pre>var objectList = root.list();
* for (var i=0; i < objectList.length; i++){
@@ -527,32 +522,13 @@
* <i>Wed Oct 18 02:01:41 GMT+01:00 1971
* Fri Nov 03 13:25:15 GMT+01:00 2000
* Mon May 29 07:43:09 GMT+01:00 1999</i></pre>
- * <br /><br />
- * With increasing amounts of subnodes tied to a HopObject
- * the use of list() becomes seriously inefficient in cases
- * where not all subnodes really need to be read out.
- * <br /><br />
- * This is due to the creation of a JavaScript array
- * containing the whole bunch of subnodes each time the
- * function is called.
- * <br /><br />
- * Instead, it is recommended to determine the amount of
- * subnodes using the function count() and looping through
- * the subnode collection using the get() function.
- * <br /><br />
- * <pre>var amount = root.size();
- * for (var i=0; i < amount; i++){
- * var myObject = root.get(i);
- * res.writeln(myObject.created);
- * }
- * <i>Wed Oct 18 02:01:41 GMT+01:00 1971
- * Fri Nov 03 13:25:15 GMT+01:00 2000
- * Mon May 29 07:43:09 GMT+01:00 1999</i></pre>
*
+ * @param {Number} startIndex as Number
+ * @param {Number} length as Number
* @return Array of HopObjects
* @type Array
*/
-HopObject.prototype.list = function() {};
+HopObject.prototype.list = function(startIndex, length) {};
/**