blob: cb25af768201fcb3e007c84e764ace6b76d2ade2 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<document url="ListExtensions.html">
<!--
WARNING: This file is automatically generated from a jsdoc processor that
turns javadoc-type comments of Javascript and special Java files into an xml file, which is
then processed by an xsl file to create this document. Do not modify this
file, but rather either modify the comments or xsl file.
-->
<properties>
<title>java.util.List Extensions</title>
</properties>
<body>
<section href="summary" name="java.util.List Extensions">
<p>Adds various function extensions to java.util.List implementations.</p>
<dl/>
<table width="100%">
<tr>
<th colspan="2">Function Summary</th>
</tr>
<tr>
<td width="5%">
<code>java.util.List</code>
</td>
<td>
<strong>
<code>
<a href="#fn_asImmutable">asImmutable()</a>
</code>
</strong>
<dd>Returns an immutable version of this list.</dd>
</td>
</tr>
<tr>
<td width="5%">
<code>java.util.List</code>
</td>
<td>
<strong>
<code>
<a href="#fn_asSynchronized">asSynchronized()</a>
</code>
</strong>
<dd>Returns a synchronized version of this list.</dd>
</td>
</tr>
<tr>
<td width="5%">
<code>Object</code>
</td>
<td>
<strong>
<code>
<a href="#fn_pop">pop()</a>
</code>
</strong>
<dd>Pops the last item off the list.</dd>
</td>
</tr>
<tr>
<td width="5%">
<code>java.util.List</code>
</td>
<td>
<strong>
<code>
<a href="#fn_sort">sort()</a>
</code>
</strong>
<dd>Sorts the list according to the natural order.</dd>
</td>
</tr>
<tr>
<td width="5%">
<code>java.util.List</code>
</td>
<td>
<strong>
<code>
<a href="#fn_sortEach">sortEach(Function func)</a>
</code>
</strong>
<dd>Sorts the list using the passed function to determine order.</dd>
</td>
</tr>
</table>
</section>
<section name="Functions">
<section href="fn_asImmutable" name="asImmutable">
<pre>java.util.List asImmutable()</pre>
<p>Returns an immutable version of this list.</p>
<dl>
<dt>
<strong>Example: </strong>
</dt>
<dd>
<pre>frozenList = list.asImmutable()</pre>
</dd>
</dl>
</section>
<section href="fn_asSynchronized" name="asSynchronized">
<pre>java.util.List asSynchronized()</pre>
<p>Returns a synchronized version of this list.</p>
<dl>
<dt>
<strong>Example: </strong>
</dt>
<dd>
<pre>multiThreadList = list.asSynchronized()</pre>
</dd>
</dl>
</section>
<section href="fn_pop" name="pop">
<pre>Object pop()</pre>
<p>Pops the last item off the list. The last item will be returned and removed from the list.</p>
<dl>
<dt>
<strong>Example: </strong>
</dt>
<dd>
<pre>lastItem = list.pop()</pre>
</dd>
</dl>
</section>
<section href="fn_sort" name="sort">
<pre>java.util.List sort()</pre>
<p>Sorts the list according to the natural order.</p>
<dl>
<dt>
<strong>Example: </strong>
</dt>
<dd>
<pre>sortedList = list.sort()</pre>
</dd>
</dl>
</section>
<section href="fn_sortEach" name="sortEach">
<pre>java.util.List sortEach(Function func)</pre>
<p>Sorts the list using the passed function to determine order. The function will receive two parameters, and should return &gt; 0 if the first is greater, &lt; 0 if the first is less, and 0 if equal.</p>
<dl>
<dt>
<strong>Example: </strong>
</dt>
<dd>
<pre>sortedList = list.sort(function(val1, val2) { return val1.compareTo(val2) })</pre>
</dd>
</dl>
</section>
</section>
</body>
</document>