/deploy/doc/apidoc/org/as3commons/collections/utils/Lists.html
HTML | 752 lines | 672 code | 71 blank | 9 comment | 0 complexity | 4266369e45e926a8c074ce3ab75d0b08 MD5 | raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
- <link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
- <meta content="Lists,org.as3commons.collections.utils.Lists,addFromArgs,addFromArray,addFromCollection,clone,copy,newArrayList,newSortedList" name="keywords">
- <title>org.as3commons.collections.utils.Lists</title>
- </head>
- <body>
- <script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
- <!--
- asdocTitle = 'Lists - AS3Commons Collections 1.3.2';
- var baseRef = '../../../../';
- window.onload = configPage;
- --></script>
- <table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
- <tr>
- <td align="left" class="titleTableTitle">AS3Commons Collections 1.3.2</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All Packages</a> | <a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All Classes</a> | <a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a> | <a href="../../../../index.html?org/as3commons/collections/utils/Lists.html&org/as3commons/collections/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
- </tr>
- <tr class="titleTableRow2">
- <td align="left" id="subTitle" class="titleTableSubTitle">Class Lists</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
- </tr>
- <tr class="titleTableRow3">
- <td colspan="2"> </td>
- </tr>
- </table>
- <script type="text/javascript" language="javascript">
- <!--
- if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Lists"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
- --></script>
- <div class="MainContent">
- <table cellspacing="0" cellpadding="0" class="classHeaderTable">
- <tr>
- <td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.as3commons.collections.utils</a></td>
- </tr>
- <tr>
- <td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Lists</td>
- </tr>
- </table>
- <p></p>
- <code>IList</code> utilities.
-
- <p id="link_ListsAddFromExample"><strong><code>Lists.addFrom...()</code> example</strong></p>
-
- <a class="exampleCollapsed" href="#link_ListsAddFromExample" onClick="toggleExample(this, 'ListsAddFromExample');">Show example</a><br /><div id="ListsAddFromExample" style='display:none'><div class='listing'><pre>package {
- import org.as3commons.collections.ArrayList;
- import org.as3commons.collections.LinkedList;
- import org.as3commons.collections.Map;
- import org.as3commons.collections.utils.Lists;
- import flash.display.Sprite;
- public class ListsAddFromExample extends Sprite {
- public function ListsAddFromExample() {
- // list to populate
- var list : ArrayList = new ArrayList();
- // from array (ordered)
- var a : Array = [1, "2", "2"];
- Lists.addFromArray(list, a);
- // from linked list (ordered)
- var l : LinkedList = new LinkedList();
- l.add("2");
- l.add(3);
- l.add("4");
- l.add(3);
- Lists.addFromCollection(list, l);
- // from map (no order)
- var m : Map = new Map();
- m.add("five", 5);
- m.add("six", "6");
- m.add("four", "4");
- Lists.addFromCollection(list, m);
- // from args (ordered)
- Lists.addFromArgs(list,
- 7, "8", "8", 5
- );
- // test
- trace (list.toArray().join("n"));
-
- // 1 // from array
- // 2
- // 2
- // 2 // from linked list
- // 3
- // 4
- // 3
- // 4 // from map
- // 6
- // 5
- // 7 // from args
- // 8
- // 8
- // 5
- }
- }
- }
- </pre></div></div>
-
- <p id="link_ListsCloneExample"><strong><code>Lists.clone()</code> example</strong></p>
-
- <a class="exampleCollapsed" href="#link_ListsCloneExample" onClick="toggleExample(this, 'ListsCloneExample');">Show example</a><br /><div id="ListsCloneExample" style='display:none'><div class='listing'><pre>package {
- import org.as3commons.collections.utils.NumericComparator;
- import flash.utils.getQualifiedClassName;
- import org.as3commons.collections.framework.IList;
- import org.as3commons.collections.utils.Lists;
- import flash.display.Sprite;
- public class ListsCloneExample extends Sprite {
- public function ListsCloneExample() {
- // clone array list
- var list : IList = Lists.newArrayList(2, 4, 1, 3);
- var clone : IList = Lists.clone(list);
- trace (list.toArray().join("n"));
- trace (getQualifiedClassName(clone));
- // 2
- // 4
- // 1
- // 3
- // org.as3commons.collections::ArrayList
- // clone sorted list
- list = Lists.newSortedList(
- new NumericComparator(),
- 2, 4, 1, 3
- );
- clone = Lists.clone(list);
- trace (list.toArray().join("n"));
- trace (getQualifiedClassName(clone));
- // 1
- // 2
- // 3
- // 4
- // org.as3commons.collections::SortedList
- }
-
- }
- }
- </pre></div></div>
-
- <p id="link_ListsCopyExample"><strong><code>Lists.copy()</code> example</strong></p>
-
- <a class="exampleCollapsed" href="#link_ListsCopyExample" onClick="toggleExample(this, 'ListsCopyExample');">Show example</a><br /><div id="ListsCopyExample" style='display:none'><div class='listing'><pre>package {
- import org.as3commons.collections.framework.IList;
- import org.as3commons.collections.utils.Lists;
- import org.as3commons.collections.utils.NumericComparator;
- import flash.display.Sprite;
- public class ListsCopyExample extends Sprite {
- public function ListsCopyExample() {
- // source
- var source : IList = Lists.newArrayList(1, 2, 3, 4);
- trace (source.toArray() + "n");
- // 1, 2, 3, 4
-
- // copy all
- var list : IList = Lists.newSortedList(
- new NumericComparator(),
- 5, 6, 7, 8
- );
- trace (list.toArray() + "n");
- // 5, 6, 7, 8
- Lists.copy(source, list);
- trace (list.toArray() + "n");
- // 1, 2, 3, 4, 5, 6, 7, 8
- // copy only even items
- list = Lists.newSortedList(
- new NumericComparator(),
- 6, 8
- );
- trace (list.toArray() + "n");
- // 6, 8
- Lists.copy(source, list, evenFilter);
- trace (list.toArray() + "n");
- // 2, 4, 6, 8
- }
-
- private function evenFilter(item : : Boolean {
- return item % 2 == 0;
- }
- }
- }
- </pre></div></div>
-
- <p id="link_AddFromArgsExample"><strong><code>Lists.new...()</code> example</strong></p>
-
- <a class="exampleCollapsed" href="#link_AddFromArgsExample" onClick="toggleExample(this, 'AddFromArgsExample');">Show example</a><br /><div id="AddFromArgsExample" style='display:none'><div class='listing'><pre>package {
- import org.as3commons.collections.framework.
- import org.as3commons.collections.utils.
- import flash.display.Sprite;
- public class AddFromArgsExample extends Sprite {
- public function AddFromArgsExample() {
- // ArrayList
- var list : IList = Lists.newArrayList(
- 1, 2, 3, 4, 5, 6, 7, 8
- );
- trace (list.toArray() + "n");
- // 1, 2, 3, 4, 5, 6, 7, 8
-
- // ArrayList
- list = Lists.newSortedList(
- new NumericComparator(),
- 6, 3, 1, 5, 8, 2, 7, 4
- );
- trace (list.toArray() + "n");
- // 1, 2, 3, 4, 5, 6, 7, 8
-
- // Set
- var theSet : ISet = Sets.newSet(
- 1, 2, 3, 4, 5, 6, 7, 8
- );
- trace (theSet.toArray() + "n");
- // 1, 2, 3, 4, 5, 6, 7, 8
-
- // LinkedSet
- theSet = Sets.newLinkedSet(
- 1, 2, 3, 4, 5, 6, 7, 8
- );
- trace (theSet.toArray() + "n");
- // 1, 2, 3, 4, 5, 6, 7, 8
-
- // SortedSet
- theSet = Sets.newSortedSet(
- new NumericComparator(),
- 6, 3, 1, 5, 8, 2, 7, 4
- );
- trace (theSet.toArray() + "n");
- // 1, 2, 3, 4, 5, 6, 7, 8
-
- // Map
- var map : IMap = Maps.newMap(
- "one", 1, "two", 2, "three", 3, "four", 4
- );
- trace (map.toArray() + "n");
- // 1, 4, 2, 3
-
- // LinkedMap
- map = Maps.newLinkedMap(
- "one", 1, "two", 2, "three", 3, "four", 4
- );
- trace (map.toArray() + "n");
- // 1, 2, 3, 4
-
- // SortedMap
- map = Maps.newSortedMap(
- new NumericComparator(),
- "one", 1, "two", 2, "three", 3, "four", 4
- );
- trace (map.toArray() + "n");
- // 1, 2, 3, 4
-
- // LinkedList
- var linkedList : ILinkedList = LinkedLists.newLinkedList(
- 1, 2, 3, 4, 5, 6, 7, 8
- );
- trace (linkedList.toArray() + "n");
- // 1, 2, 3, 4, 5, 6, 7, 8
- }
- }
- }
- </pre></div></div>
-
- <p id="link_NestedCollectionsExample"><strong>Nested collections example</strong></p>
-
- <a class="exampleCollapsed" href="#link_NestedCollectionsExample" onClick="toggleExample(this, 'NestedCollectionsExample');">Show example</a><br /><div id="NestedCollectionsExample" style='display:none'><div class='listing'><pre>package {
- import org.as3commons.collections.ArrayList;
- import org.as3commons.collections.LinkedSet;
- import org.as3commons.collections.framework.IComparator;
- import org.as3commons.collections.utils.
- import flash.display.Sprite;
- public class NestedCollectionsExample extends Sprite {
- public function NestedCollectionsExample() {
- // nested array list
- var list : ArrayList = Lists.newArrayList(
- Lists.newArrayList(1, 2),
- Lists.newArrayList(
- Lists.newArrayList(3, 4),
- Lists.newArrayList(5, 6)
- ),
- Lists.newArrayList(7, 8),
- Lists.newArrayList(
- Lists.newArrayList(9, 10),
- Lists.newArrayList(11, 12)
- )
- );
- trace (CollectionUtils.dumpAsString(list));
- // [object ArrayList]
- // .......[object ArrayList]
- // ..............1
- // ..............2
- // .......[object ArrayList]
- // ..............[object ArrayList]
- // .....................3
- // .....................4
- // ..............[object ArrayList]
- // .....................5
- // .....................6
- // .......[object ArrayList]
- // ..............7
- // ..............8
- // .......[object ArrayList]
- // ..............[object ArrayList]
- // .....................9
- // .....................10
- // ..............[object ArrayList]
- // .....................11
- // .....................12
-
- // nested mixed collection
- var c : IComparator = new NumericComparator();
- var theSet : LinkedSet = Sets.newLinkedSet(
- Maps.newLinkedMap("one", 1, "two", 2),
- Lists.newArrayList(
- Sets.newSortedSet(c, 4, 3),
- LinkedLists.newLinkedList(5, 6)
- ),
- Lists.newSortedList(c, 8, 7),
- Lists.newArrayList(
- Maps.newLinkedMap("nine", 9, "ten", 10),
- Maps.newSortedMap(c, "twelve", 12, "eleven", 11)
- )
- );
- trace (CollectionUtils.dumpAsString(theSet));
- // [object LinkedSet]
- // .......[object LinkedMap]
- // ..............1
- // ..............2
- // .......[object ArrayList]
- // ..............[object SortedSet]
- // .....................3
- // .....................4
- // ..............[object LinkedList]
- // .....................5
- // .....................6
- // .......[object SortedList]
- // ..............7
- // ..............8
- // .......[object ArrayList]
- // ..............[object LinkedMap]
- // .....................9
- // .....................10
- // ..............[object SortedMap]
- // .....................11
- // .....................12
- }
- }
- }
- </pre></div></div>
-
- <p></p>
- <br>
- <hr>
- </div>
- <a name="methodSummary"></a>
- <div class="summarySection">
- <div class="summaryTableTitle">Public Methods</div>
- <table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
- <tr>
- <th> </th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined by</th>
- </tr>
- <tr class="">
- <td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
- <div class="summarySignature">
- <a class="signatureLink" href="#addFromArgs()">addFromArgs</a>(list:<a href="../framework/IList.html">IList</a>, ... args):uint</div>
- <div class="summaryTableDescription">[static]
- Adds the given list of items to the specified list.</div>
- </td><td class="summaryTableOwnerCol">Lists</td>
- </tr>
- <tr class="">
- <td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
- <div class="summarySignature">
- <a class="signatureLink" href="#addFromArray()">addFromArray</a>(list:<a href="../framework/IList.html">IList</a>, source:Array):uint</div>
- <div class="summaryTableDescription">[static]
- Adds the contents of the given <code>Array</code> to the specified list.</div>
- </td><td class="summaryTableOwnerCol">Lists</td>
- </tr>
- <tr class="">
- <td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
- <div class="summarySignature">
- <a class="signatureLink" href="#addFromCollection()">addFromCollection</a>(list:<a href="../framework/IList.html">IList</a>, source:<a href="../framework/ICollection.html">ICollection</a>):uint</div>
- <div class="summaryTableDescription">[static]
- Adds the contents of the given <code>ICollection</code> to the specified list.</div>
- </td><td class="summaryTableOwnerCol">Lists</td>
- </tr>
- <tr class="">
- <td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
- <div class="summarySignature">
- <a class="signatureLink" href="#clone()">clone</a>(list:<a href="../framework/IList.html">IList</a>, filter:Function = null):<a href="../framework/IList.html">IList</a>
- </div>
- <div class="summaryTableDescription">[static]
- Clones the supplied <code>IList</code> instance returning a new <code>IList</code>
- of the same type.</div>
- </td><td class="summaryTableOwnerCol">Lists</td>
- </tr>
- <tr class="">
- <td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
- <div class="summarySignature">
- <a class="signatureLink" href="#copy()">copy</a>(source:<a href="../framework/IList.html">IList</a>, destination:<a href="../framework/IList.html">IList</a>, filter:Function = null):uint</div>
- <div class="summaryTableDescription">[static]
- Copies items from one list to another.</div>
- </td><td class="summaryTableOwnerCol">Lists</td>
- </tr>
- <tr class="">
- <td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
- <div class="summarySignature">
- <a class="signatureLink" href="#newArrayList()">newArrayList</a>(... args):<a href="../../collections/ArrayList.html">ArrayList</a>
- </div>
- <div class="summaryTableDescription">[static]
- Creates, populates and returns a new <code>ArrayList</code> instance.</div>
- </td><td class="summaryTableOwnerCol">Lists</td>
- </tr>
- <tr class="">
- <td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol">
- <div class="summarySignature">
- <a class="signatureLink" href="#newSortedList()">newSortedList</a>(comparator:<a href="../framework/IComparator.html">IComparator</a>, ... args):<a href="../../collections/SortedList.html">SortedList</a>
- </div>
- <div class="summaryTableDescription">[static]
- Creates, populates and returns a new <code>ArrayList</code> instance.</div>
- </td><td class="summaryTableOwnerCol">Lists</td>
- </tr>
- </table>
- </div>
- <script type="text/javascript" language="javascript">
- <!--
- showHideInherited();
- --></script>
- <div class="MainContent">
- <a name="methodDetail"></a>
- <div class="detailSectionHeader">Method detail</div>
- <a name="addFromArgs()"></a>
- <table cellspacing="0" cellpadding="0" class="detailHeader">
- <tr>
- <td class="detailHeaderName">addFromArgs</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
- </tr>
- </table>
- <div class="detailBody">
- <code>public static function addFromArgs(list:<a href="../framework/IList.html">IList</a>, ... args):uint</code><p>
- Adds the given list of items to the specified list.
-
- <div class='listing'><pre>
- Lists.addFromArgs(myList, item1, item2, ...);
- </pre></div>
-
- </p><span class="label">Parameters</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/IList.html">IList</a></code> — The list to populate.
- </td>
- </tr>
- <tr>
- <td class="paramSpacer"> </td>
- </tr>
- <tr>
- <td width="20px"></td><td><code>... <span class="label">args</span></code> — List of items to add to the list.
- </td>
- </tr>
- </table>
- <p></p>
- <span class="label">Returns</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20"></td><td><code>uint</code> — The number of items added to the list.
- </td>
- </tr>
- </table>
- </div>
- <a name="addFromArray()"></a>
- <table cellspacing="0" cellpadding="0" class="detailHeader">
- <tr>
- <td class="detailHeaderName">addFromArray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td>
- </tr>
- </table>
- <div class="detailBody">
- <code>public static function addFromArray(list:<a href="../framework/IList.html">IList</a>, source:Array):uint</code><p>
- Adds the contents of the given <code>Array</code> to the specified list.
-
- <div class='listing'><pre>
- var array : Array = [item1, item2, ...];
- var count : uint = Lists.addFromArray(list, array);
- </pre></div>
-
- </p><span class="label">Parameters</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/IList.html">IList</a></code> — The list to populate.
- </td>
- </tr>
- <tr>
- <td class="paramSpacer"> </td>
- </tr>
- <tr>
- <td width="20px"></td><td><code><span class="label">source</span>:Array</code> — The <code>Array</code> to add from.
- </td>
- </tr>
- </table>
- <p></p>
- <span class="label">Returns</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20"></td><td><code>uint</code> — The number of items added to the list.
- </td>
- </tr>
- </table>
- </div>
- <a name="addFromCollection()"></a>
- <table cellspacing="0" cellpadding="0" class="detailHeader">
- <tr>
- <td class="detailHeaderName">addFromCollection</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td>
- </tr>
- </table>
- <div class="detailBody">
- <code>public static function addFromCollection(list:<a href="../framework/IList.html">IList</a>, source:<a href="../framework/ICollection.html">ICollection</a>):uint</code><p>
- Adds the contents of the given <code>ICollection</code> to the specified list.
-
- <div class='listing'><pre>
- var count : uint = Lists.addFromCollection(list, sourceCollection);
- </pre></div>
-
- </p><span class="label">Parameters</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/IList.html">IList</a></code> — The list to populate.
- </td>
- </tr>
- <tr>
- <td class="paramSpacer"> </td>
- </tr>
- <tr>
- <td width="20px"></td><td><code><span class="label">source</span>:<a href="../framework/ICollection.html">ICollection</a></code> — The <code>ICollection</code> to add from.
- </td>
- </tr>
- </table>
- <p></p>
- <span class="label">Returns</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20"></td><td><code>uint</code> — The number of items added to the list.
- </td>
- </tr>
- </table>
- </div>
- <a name="clone()"></a>
- <table cellspacing="0" cellpadding="0" class="detailHeader">
- <tr>
- <td class="detailHeaderName">clone</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td>
- </tr>
- </table>
- <div class="detailBody">
- <code>public static function clone(list:<a href="../framework/IList.html">IList</a>, filter:Function = null):<a href="../framework/IList.html">IList</a></code><p>
- Clones the supplied <code>IList</code> instance returning a new <code>IList</code>
- of the same type.
-
- </p><p>If a filter is specified the resulting list only contains items that
- meet the supplied predicates.<p>
-
- <p>The filter function accepts the current item and returns a boolean
- value (<code>true</code> if the item is accepted).</p>
-
- <div class='listing'><pre>
- function itemFilter(item : : Boolean {
- var accept : Boolean = false;
- // test the item
- return accept;
- }
-
- var list : IList = Lists.clone(list, filter);
- </pre></div>
-
- <span class="label">Parameters</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/IList.html">IList</a></code> — The <code>IList</code> instance to clone.
- </td>
- </tr>
- <tr>
- <td class="paramSpacer"> </td>
- </tr>
- <tr>
- <td width="20px"></td><td><code><span class="label">filter</span>:Function</code> (default = <code>null</code>)<code></code> — Function which will be applied to each item in the source list.
- </td>
- </tr>
- </table>
- <p></p>
- <span class="label">Returns</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20"></td><td><code><a href="../framework/IList.html">IList</a></code> —
- A new <code>IList</code> instance.
-
-
- </td>
- </tr>
- </table>
- </div>
- <a name="copy()"></a>
- <table cellspacing="0" cellpadding="0" class="detailHeader">
- <tr>
- <td class="detailHeaderName">copy</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td>
- </tr>
- </table>
- <div class="detailBody">
- <code>public static function copy(source:<a href="../framework/IList.html">IList</a>, destination:<a href="../framework/IList.html">IList</a>, filter:Function = null):uint</code><p>
- Copies items from one list to another.
-
- </p><p>If a filter is specified only items are copied that meet the
- supplied predicates.<p>
-
- <p>The filter function accepts the current item and returns a boolean
- value (<code>true</code> if the item is accepted).</p>
-
- <div class='listing'><pre>
- function itemFilter(item : : Boolean {
- var accept : Boolean = false;
- // test the item
- return accept;
- }
-
- Lists.copy(sourceList, destinationList, filter);
- </pre></div>
-
- <span class="label">Parameters</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20px"></td><td><code><span class="label">source</span>:<a href="../framework/IList.html">IList</a></code> — The <code>IList</code> instance to copy from.
- </td>
- </tr>
- <tr>
- <td class="paramSpacer"> </td>
- </tr>
- <tr>
- <td width="20px"></td><td><code><span class="label">destination</span>:<a href="../framework/IList.html">IList</a></code> — The <code>IList</code> to copy to.
- </td>
- </tr>
- <tr>
- <td class="paramSpacer"> </td>
- </tr>
- <tr>
- <td width="20px"></td><td><code><span class="label">filter</span>:Function</code> (default = <code>null</code>)<code></code> — Function which will be applied to each item in the source list.
- </td>
- </tr>
- </table>
- <p></p>
- <span class="label">Returns</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20"></td><td><code>uint</code> — The number of items copied to the list.
- </td>
- </tr>
- </table>
- </div>
- <a name="newArrayList()"></a>
- <table cellspacing="0" cellpadding="0" class="detailHeader">
- <tr>
- <td class="detailHeaderName">newArrayList</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td>
- </tr>
- </table>
- <div class="detailBody">
- <code>public static function newArrayList(... args):<a href="../../collections/ArrayList.html">ArrayList</a></code><p>
- Creates, populates and returns a new <code>ArrayList</code> instance.
-
- </p><p>The arguments may be left out. In that case no item is added to the list.</p>
-
- <div class='listing'><pre>
- var list : ArrayList = Lists.newArrayList(item1, item2, ...);
- </pre></div>
-
- <span class="label">Parameters</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20px"></td><td><code>... <span class="label">args</span></code> — List of items to add to the list.
- </td>
- </tr>
- </table>
- <p></p>
- <span class="label">Returns</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20"></td><td><code><a href="../../collections/ArrayList.html">ArrayList</a></code> —
- A new <code>ArrayList</code> instance populated from the given arguments.
-
-
- </td>
- </tr>
- </table>
- </div>
- <a name="newSortedList()"></a>
- <table cellspacing="0" cellpadding="0" class="detailHeader">
- <tr>
- <td class="detailHeaderName">newSortedList</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td>
- </tr>
- </table>
- <div class="detailBody">
- <code>public static function newSortedList(comparator:<a href="../framework/IComparator.html">IComparator</a>, ... args):<a href="../../collections/SortedList.html">SortedList</a></code><p>
- Creates, populates and returns a new <code>ArrayList</code> instance.
-
- </p><p>The arguments may be left out. In that case no item is added to the list.</p>
-
- <div class='listing'><pre>
- var list : ArrayList = Lists.newSortedList(comparator, item1, item2, ...);
- </pre></div>
-
- <span class="label">Parameters</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20px"></td><td><code><span class="label">comparator</span>:<a href="../framework/IComparator.html">IComparator</a></code> — List of items to add to the list.
- </td>
- </tr>
- <tr>
- <td class="paramSpacer"> </td>
- </tr>
- <tr>
- <td width="20px"></td><td><code>... <span class="label">args</span></code> — The sort criterion.
- </td>
- </tr>
- </table>
- <p></p>
- <span class="label">Returns</span>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="20"></td><td><code><a href="../../collections/SortedList.html">SortedList</a></code> —
- A new <code>SortedList</code> instance populated from the given arguments.
-
-
- </td>
- </tr>
- </table>
- </div>
- <br>
- <br>
- <hr>
- <br>
- <p></p>
- <center class="copyright">
- </center>
- </div>
- </body>
- </html>
- <!-- -->