Class Sort
- java.lang.Object
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- java.lang.Iterable<Resource>,- ResourceCollection
 
 public class Sort extends BaseResourceCollectionWrapper ResourceCollection that sorts another ResourceCollection. Note that Sort must not be used in cases where the ordering of the objects being sorted might change during the sorting process.- Since:
- Ant 1.7
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description Sort()
 - 
Method SummaryModifier and Type Method Description voidadd(ResourceComparator c)Add a ResourceComparator to this Sort ResourceCollection.protected voiddieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p)Overrides the BaseResourceCollectionContainer version to recurse on nested ResourceComparators.protected java.util.Collection<Resource>getCollection()Sort the contained elements.- 
Methods inherited from class org.apache.tools.ant.types.resources.BaseResourceCollectionWrappercreateIterator, getSize
 - 
Methods inherited from class org.apache.tools.ant.types.resources.AbstractResourceCollectionWrapperadd, getResourceCollection, isCache, isFilesystemOnly, iterator, setCache, size, toString
 - 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 - 
Methods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.tools.ant.types.ResourceCollectionisEmpty, stream
 
- 
 
- 
- 
- 
Method Detail- 
getCollectionprotected java.util.Collection<Resource> getCollection() Sort the contained elements.- Specified by:
- getCollectionin class- BaseResourceCollectionWrapper
- Returns:
- a Collection of Resources.
 
 - 
addpublic void add(ResourceComparator c) Add a ResourceComparator to this Sort ResourceCollection. If multiple ResourceComparators are added, they will be processed in LIFO order.- Parameters:
- c- the ResourceComparator to add.
 
 - 
dieOnCircularReferenceprotected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p) throws BuildExceptionOverrides the BaseResourceCollectionContainer version to recurse on nested ResourceComparators.- Overrides:
- dieOnCircularReferencein class- AbstractResourceCollectionWrapper
- Parameters:
- stk- the stack of data types to use (recursively).
- p- the project to use to dereference the references.
- Throws:
- BuildException- on error.
 
 
- 
 
-