blob: c7684b4d1ca9f5ec4a20c1e0fdbca76177e2565b [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_181) on Wed Oct 10 00:41:12 CEST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CollectionTool (VelocityTools 3.0 API)</title>
<meta name="date" content="2018-10-10">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CollectionTool (VelocityTools 3.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":9,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CollectionTool.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/velocity/tools/generic/ClassTool.Sub.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.PropertiesComparator.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/velocity/tools/generic/CollectionTool.html" target="_top">Frames</a></li>
<li><a href="CollectionTool.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.velocity.tools.generic</div>
<h2 title="Class CollectionTool" class="title">Class CollectionTool</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.SafeConfig</a></li>
<li>
<ul class="inheritance">
<li>org.apache.velocity.tools.generic.CollectionTool</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/velocity/tools/generic/SortTool.html" title="class in org.apache.velocity.tools.generic">SortTool</a></dd>
</dl>
<hr>
<br>
<pre><a href="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</a>(<a href="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value--">value</a>="collection")
public class <span class="typeNameLabel">CollectionTool</span>
extends <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a>
implements <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block"><p>CollectionTool allows a user to sort a collection (or array, iterator, etc)
on any arbitrary set of properties exposed by the objects contained
within the collection, and to generate arrays by splitting strings.
</p>
<p>The sort functionality is specifically designed to use within a #foreach
but you may find other uses for it.</p>
<p>The sort methods can handle all of the collection types supported by
#foreach and the same constraints apply as well as the following.
Every object in the collection must support the set of properties
selected to sort on. Each property which is to be sorted on must
return one of the follow:</p>
<ul>
<li>Primitive type: e.g. int, char, long etc</li>
<li>Standard Object: e.g. String, Integer, Long etc</li>
<li>Object which implements the Comparable interface.</li>
</ul>
<p>During the sort operation all properties are compared by calling
compareTo() with the exception of Strings for which
compareToIgnoreCase() is called.</p>
<p>The sort is performed by calling Collections.sort() after
marshalling the collection to sort into an appropriate collection type.
The original collection will not be re-ordered; a new list containing
the sorted elements will always be returned.</p>
<p>The tool is used as follows:</p>
<pre>
Single Property Sort
#foreach($obj in $sorter.sort($objects, "name"))
$obj.name Ordinal= $obj.ordinal
#end
End
Multiple Property Sort
#foreach($obj in $sorter.sort($objects, ["name", "ordinal"]))
$obj.name, $obj.ordinal
#end
End
</pre>
<p>The sort method takes two parameters, a collection and a property name
or an array of property names. The property names and corresponding
methods must conform to java bean standards since commons-beanutils
is used to extract the property values.</p>
<p>By default the sort tool sorts ascending, you can override this by
adding a sort type suffix to any property name.</p>
<p>The supported suffixes are:</p>
<pre>
For ascending
:asc
For descending
:desc
Example
#foreach($obj in $sorter.sort($objects, ["name:asc", "ordinal:desc"]))
$obj.name, $obj.ordinal
#end
</pre>
<p>This will sort first by Name in ascending order and then by Ordinal
in descending order, of course you could have left the :asc off of the
'Name' property as ascending is always the default.</p>
<p>Example tools.xml config (if you want to use this with VelocityView):</p>
<pre>
&lt;tools&gt;
&lt;toolbox scope="application"&gt;
&lt;tool class="org.apache.velocity.tools.generic.SortTool"/&gt;
&lt;/toolbox&gt;
&lt;/tools&gt;
</pre></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 3.0</dd>
<dt><span class="simpleTagLabel">Version:</span></dt>
<dd>$Id: CollectionTool.java 1842514 2018-10-01 16:09:11Z cbrisson $</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>S. Brett Sutton, Nathan Bubna</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../serialized-form.html#org.apache.velocity.tools.generic.CollectionTool">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.PropertiesComparator.html" title="class in org.apache.velocity.tools.generic">CollectionTool.PropertiesComparator</a></span></code>
<div class="block">Does all of the comparisons</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#DEFAULT_STRINGS_DELIMITER">DEFAULT_STRINGS_DELIMITER</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#DEFAULT_STRINGS_TRIM">DEFAULT_STRINGS_TRIM</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#STRINGS_DELIMITER_FORMAT_KEY">STRINGS_DELIMITER_FORMAT_KEY</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#STRINGS_TRIM_KEY">STRINGS_TRIM_KEY</a></span></code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3>
<code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOCK_CONFIG_KEY">LOCK_CONFIG_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#log">log</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOGGER_NAME_KEY">LOGGER_NAME_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#SAFE_MODE_KEY">SAFE_MODE_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#USE_CLASS_LOGGER_KEY">USE_CLASS_LOGGER_KEY</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#CollectionTool--">CollectionTool</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></span>(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a>&nbsp;values)</code>
<div class="block">Does the actual configuration.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#getComparable-java.lang.Object-java.lang.String-">getComparable</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property)</code>
<div class="block">Safely retrieves the comparable value for the specified property
from the specified object.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#getStringsDelimiter--">getStringsDelimiter</a></span>()</code>
<div class="block">Gets the configured strings delimiter</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#getStringsTrim--">getStringsTrim</a></span>()</code>
<div class="block">Gets whether to trim strings</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#internalSort-java.util.List-java.util.List-">internalSort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;list,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</code>
<div class="block">Internal sorting method.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#setStringsDelimiter-java.lang.String-">setStringsDelimiter</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;stringsDelimiter)</code>
<div class="block">Sets the delimiter used for separating values in a single String value.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#setStringsTrim-boolean-">setStringsTrim</a></span>(boolean&nbsp;stringsTrim)</code>
<div class="block">Sets whether strings should be trimmed when separated from
a delimited string value.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.util.Collection-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;collection)</code>
<div class="block">Sort a collection</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.util.Collection-java.util.Comparator-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;T&gt;&nbsp;c,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</code>
<div class="block">Sorts a Collection using a Comparator.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.util.Collection-java.util.List-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;collection,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</code>
<div class="block">Sorts the collection on several properties.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.util.Map-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;map)</code>
<div class="block">Sort map values</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.util.Map-java.util.Comparator-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,T&gt;&nbsp;map,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</code>
<div class="block">Sorts a Map's values using a Comparator.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.util.Map-java.util.List-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;map,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</code>
<div class="block">Sorts map values on several properties.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.lang.Object-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</code>
<div class="block">Sort a collection, array or map</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.lang.Object:A-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;array)</code>
<div class="block">Sort an array</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.lang.Object:A-java.util.List-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;array,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</code>
<div class="block">Sorts array on several properties.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.lang.Object-java.util.Comparator-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;o,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;?&gt;&nbsp;comparator)</code>
<div class="block">Sorts a Collection (or array, or Map's values)
using a Comparator.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-java.lang.Object-java.lang.String-">sort</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property)</code>
<div class="block">Sorts the collection on a single property.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#sort-T:A-java.util.Comparator-">sort</a></span>(T[]&nbsp;a,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</code>
<div class="block">Sorts an array using a Comparator.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#split-java.lang.String-">split</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3>
<code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-java.util.Map-">configure</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#getLog--">getLog</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#initLogger-org.apache.velocity.tools.generic.ValueParser-">initLogger</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isConfigLocked--">isConfigLocked</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isSafeMode--">isSafeMode</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setLockConfig-boolean-">setLockConfig</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setSafeMode-boolean-">setSafeMode</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="STRINGS_DELIMITER_FORMAT_KEY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>STRINGS_DELIMITER_FORMAT_KEY</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> STRINGS_DELIMITER_FORMAT_KEY</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.CollectionTool.STRINGS_DELIMITER_FORMAT_KEY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="STRINGS_TRIM_KEY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>STRINGS_TRIM_KEY</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> STRINGS_TRIM_KEY</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.CollectionTool.STRINGS_TRIM_KEY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="DEFAULT_STRINGS_DELIMITER">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_STRINGS_DELIMITER</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> DEFAULT_STRINGS_DELIMITER</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.CollectionTool.DEFAULT_STRINGS_DELIMITER">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="DEFAULT_STRINGS_TRIM">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DEFAULT_STRINGS_TRIM</h4>
<pre>public static final&nbsp;boolean DEFAULT_STRINGS_TRIM</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.CollectionTool.DEFAULT_STRINGS_TRIM">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="CollectionTool--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CollectionTool</h4>
<pre>public&nbsp;CollectionTool()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setStringsDelimiter-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStringsDelimiter</h4>
<pre>protected final&nbsp;void&nbsp;setStringsDelimiter(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;stringsDelimiter)</pre>
<div class="block">Sets the delimiter used for separating values in a single String value.
The default string delimiter is a comma.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stringsDelimiter</code> - strings delimiter</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#split-java.lang.String-"><code>split(String)</code></a></dd>
</dl>
</li>
</ul>
<a name="getStringsDelimiter--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStringsDelimiter</h4>
<pre>public final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getStringsDelimiter()</pre>
<div class="block">Gets the configured strings delimiter</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>strings delimiter</dd>
</dl>
</li>
</ul>
<a name="setStringsTrim-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setStringsTrim</h4>
<pre>protected final&nbsp;void&nbsp;setStringsTrim(boolean&nbsp;stringsTrim)</pre>
<div class="block">Sets whether strings should be trimmed when separated from
a delimited string value.
The default is true.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stringsTrim</code> - flag value</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.html#split-java.lang.String-"><code>split(String)</code></a></dd>
</dl>
</li>
</ul>
<a name="getStringsTrim--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStringsTrim</h4>
<pre>public final&nbsp;boolean&nbsp;getStringsTrim()</pre>
<div class="block">Gets whether to trim strings</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether to trim strings</dd>
</dl>
</li>
</ul>
<a name="configure-org.apache.velocity.tools.generic.ValueParser-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>configure</h4>
<pre>protected&nbsp;void&nbsp;configure(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a>&nbsp;values)</pre>
<div class="block">Does the actual configuration. This is protected, so
subclasses may share the same ValueParser and call configure
at any time, while preventing templates from doing so when
configure(Map) is locked.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - configuration values</dd>
</dl>
</li>
</ul>
<a name="split-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>split</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;split(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - the value to be converted</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of String objects containing all of the values
derived from the specified array, Collection, or delimited String</dd>
</dl>
</li>
</ul>
<a name="sort-java.util.Collection-java.util.Comparator-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;T&gt;&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;T&gt;&nbsp;c,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</pre>
<div class="block">Sorts a Collection using a Comparator. A defensive copy is made
of the Collection beforehand, so the original Collection is left
untouched and null elements filtered out.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - collection content class</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>c</code> - The Collection to sort.</dd>
<dd><code>comparator</code> - The comparator to use for sorting.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A copy of the original Collection,
sorted using the supplied Comparator.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 2.0.1</dd>
</dl>
</li>
</ul>
<a name="sort-java.lang.Object:A-java.util.Comparator-">
<!-- -->
</a><a name="sort-T:A-java.util.Comparator-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;T[]&nbsp;sort(T[]&nbsp;a,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</pre>
<div class="block">Sorts an array using a Comparator. A defensive copy is made
of the array beforehand, so the original array is left
untouched and null elements filtered out.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - array content class</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>a</code> - The array to sort.</dd>
<dd><code>comparator</code> - The comparator to use for sorting.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A copy of the original array,
sorted using the supplied Comparator.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 2.0.1</dd>
</dl>
</li>
</ul>
<a name="sort-java.util.Map-java.util.Comparator-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;T&gt;&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,T&gt;&nbsp;map,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;T&gt;&nbsp;comparator)</pre>
<div class="block">Sorts a Map's values using a Comparator. A defensive copy is made
of the values beforehand, so the original Map is left
untouched.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Map values class</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>map</code> - The Map whose values should be sorted.</dd>
<dd><code>comparator</code> - The comparator to use for sorting.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A copy of the original Map's values,
sorted using the supplied Comparator.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 2.0.1</dd>
</dl>
</li>
</ul>
<a name="sort-java.lang.Object-java.util.Comparator-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;o,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;?&gt;&nbsp;comparator)</pre>
<div class="block">Sorts a Collection (or array, or Map's values)
using a Comparator. A defensive copy is made
of the original beforehand, so the original is left
untouched. Unsupported collection objects result in
a <code>null</code> return value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>o</code> - The Collection to sort.</dd>
<dd><code>comparator</code> - The comparator to use for sorting.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A copy of the original Collection,
sorted using the supplied Comparator.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 2.0.1</dd>
</dl>
</li>
</ul>
<a name="sort-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;collection)</pre>
<div class="block">Sort a collection</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>collection</code> - collection to sort, left unchanged</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new sorted collection</dd>
</dl>
</li>
</ul>
<a name="sort-java.lang.Object:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;array)</pre>
<div class="block">Sort an array</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>array</code> - array to sort, left unchanged</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new sorted collection</dd>
</dl>
</li>
</ul>
<a name="sort-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;map)</pre>
<div class="block">Sort map values</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>map</code> - map to sort</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new sorted collection of map values</dd>
</dl>
</li>
</ul>
<a name="sort-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</pre>
<div class="block">Sort a collection, array or map</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - collection, array or map to sort</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new sorted collection, or null of object type is not supported</dd>
</dl>
</li>
</ul>
<a name="sort-java.lang.Object-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property)</pre>
<div class="block">Sorts the collection on a single property.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - the collection to be sorted, left unchanged.</dd>
<dd><code>property</code> - the property to sort on.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new collection, sorted.</dd>
</dl>
</li>
</ul>
<a name="sort-java.util.Collection-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;collection,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</pre>
<div class="block">Sorts the collection on several properties.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>collection</code> - the collection to be sorted, left unchanged.</dd>
<dd><code>properties</code> - the properties to sort on.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new collection, sorted.</dd>
</dl>
</li>
</ul>
<a name="sort-java.util.Map-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;map,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</pre>
<div class="block">Sorts map values on several properties.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>map</code> - the map to be sorted, left unchanged.</dd>
<dd><code>properties</code> - the properties to sort on.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new collection, sorted.</dd>
</dl>
</li>
</ul>
<a name="sort-java.lang.Object:A-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sort</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;sort(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;array,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</pre>
<div class="block">Sorts array on several properties.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>array</code> - array to be sorted, left unchanged.</dd>
<dd><code>properties</code> - the properties to sort on.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new collection, sorted.</dd>
</dl>
</li>
</ul>
<a name="internalSort-java.util.List-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>internalSort</h4>
<pre>protected&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;internalSort(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;list,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;properties)</pre>
<div class="block">Internal sorting method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>list</code> - values to sort.</dd>
<dd><code>properties</code> - the properties to sort on.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new collection, sorted.</dd>
</dl>
</li>
</ul>
<a name="getComparable-java.lang.Object-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getComparable</h4>
<pre>protected static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&nbsp;getComparable(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property)</pre>
<div class="block">Safely retrieves the comparable value for the specified property
from the specified object. Subclasses that wish to perform more
advanced, efficient, or just different property retrieval methods
should override this method to do so.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - target object</dd>
<dd><code>property</code> - target property</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>comparable</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CollectionTool.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/velocity/tools/generic/ClassTool.Sub.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/velocity/tools/generic/CollectionTool.PropertiesComparator.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/velocity/tools/generic/CollectionTool.html" target="_top">Frames</a></li>
<li><a href="CollectionTool.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>