Top Description Fields Constructors Methods
org.apache.tools.ant.types.resources.comparators

public Class Reverse

extends ResourceComparator
Class Inheritance
Imports
java.util.Comparator, .Optional, .Stack, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.types.Resource

Reverses another ResourceComparator. If no nested ResourceComparator is supplied, the compared Resources' natural order will be reversed.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private ResourceComparator
private static final String

Constructor Summary

AccessConstructor and Description
public
Reverse()

Default constructor.

public
Reverse(ResourceComparator
the ResourceComparator to reverse.
c
)

Construct a new Reverse, supplying the ResourceComparator to be reversed.

Method Summary

Modifier and TypeMethod and Description
public void
add(ResourceComparator
the ResourceComparator to add.
c
)

Add the ResourceComparator to reverse.

protected void
dieOnCircularReference(Stack<Object>
the stack of references to check.
stk
,
Project
the project to use to dereference the references.
p
)

Overrides org.apache.tools.ant.types.DataType.dieOnCircularReference.

Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).
protected int

Returns:

a negative integer, zero, or a positive integer as the first argument is greater than, equal to, or less than the second.
resourceCompare
(Resource
the first Resource.
foo
,
Resource
the second Resource.
bar
)

Implements abstract org.apache.tools.ant.types.resources.comparators.ResourceComparator.resourceCompare.

Compare two Resources.
Inherited from org.apache.tools.ant.types.resources.comparators.ResourceComparator:
compareequalshashCode

Field Detail

nestedback to summary
private ResourceComparator nested
ONE_NESTEDback to summary
private static final String ONE_NESTED

Constructor Detail

Reverseback to summary
public Reverse()

Default constructor.

Reverseback to summary
public Reverse(ResourceComparator c)

Construct a new Reverse, supplying the ResourceComparator to be reversed.

Parameters
c:ResourceComparator

the ResourceComparator to reverse.

Method Detail

addback to summary
public void add(ResourceComparator c)

Add the ResourceComparator to reverse.

Parameters
c:ResourceComparator

the ResourceComparator to add.

dieOnCircularReferenceback to summary
protected void dieOnCircularReference(Stack<Object> stk, Project p) throws BuildException

Overrides org.apache.tools.ant.types.DataType.dieOnCircularReference.

Doc from org.apache.tools.ant.types.DataType.dieOnCircularReference.

Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).

If one is included, throw a BuildException created by circularReference.

This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.

The general contract of this method is that it shouldn't do anything if checked is true and set it to true on exit.

Parameters
stk:Stack<Object>

the stack of references to check.

p:Project

the project to use to dereference the references.

Exceptions
BuildException:
on error.
resourceCompareback to summary
protected int resourceCompare(Resource foo, Resource bar)

Implements abstract org.apache.tools.ant.types.resources.comparators.ResourceComparator.resourceCompare.

Compare two Resources.

Parameters
foo:Resource

the first Resource.

bar:Resource

the second Resource.

Returns:int

a negative integer, zero, or a positive integer as the first argument is greater than, equal to, or less than the second.