Class Sort

  extended by
      extended by
          extended by
              extended by
                  extended by
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.

Ant 1.7

Field Summary
Fields inherited from class
checked, ref
Fields inherited from class
description, location, project
Constructor Summary
Method Summary
 void add(ResourceComparator c)
          Add a ResourceComparator to this Sort ResourceCollection.
protected  void dieOnCircularReference(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
createIterator, getSize
Methods inherited from class
add, getResourceCollection, isCache, isFilesystemOnly, iterator, setCache, size, toString
Methods inherited from class
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes
Methods inherited from class
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public Sort()
Method Detail


protected java.util.Collection<Resource> getCollection()
Sort the contained elements.

Specified by:
getCollection in class BaseResourceCollectionWrapper
a Collection of Resources.


public void add(ResourceComparator c)
Add a ResourceComparator to this Sort ResourceCollection. If multiple ResourceComparators are added, they will be processed in LIFO order.

c - the ResourceComparator to add.


protected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk,
                                      Project p)
                               throws BuildException
Overrides the BaseResourceCollectionContainer version to recurse on nested ResourceComparators.

dieOnCircularReference in class AbstractResourceCollectionWrapper
stk - the stack of data types to use (recursively).
p - the project to use to dereference the references.
BuildException - on error.