org.apache.tools.ant.types.resources

Class Union

Implemented Interfaces:
Cloneable, ResourceCollection

public class Union
extends BaseResourceCollectionContainer

ResourceCollection representing the union of multiple nested ResourceCollections.
Since:
Ant 1.7

Field Summary

Fields inherited from class org.apache.tools.ant.types.DataType

checked, ref

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Constructor Summary

Union()
Default constructor.
Union(ResourceCollection rc)
Convenience constructor.

Method Summary

protected Collection
getCollection()
Unify the contained Resources.
protected Collection
getCollection(boolean asString)
Unify the contained Resources.
static Union
getInstance(ResourceCollection rc)
Static convenience method to union an arbitrary set of Resources.
String[]
list()
Returns all Resources in String format.
Resource[]
listResources()
Convenience method.

Methods inherited from class org.apache.tools.ant.types.resources.BaseResourceCollectionContainer

add, addAll, clear, clone, dieOnCircularReference, getCollection, getResourceCollections, isCache, isFilesystemOnly, iterator, setCache, size, toString

Methods inherited from class org.apache.tools.ant.types.DataType

checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Constructor Details

Union

public Union()
Default constructor.

Union

public Union(ResourceCollection rc)
Convenience constructor.
Parameters:
rc - the ResourceCollection to add.

Method Details

getCollection

protected Collection getCollection()
Unify the contained Resources.
Overrides:
getCollection in interface BaseResourceCollectionContainer
Returns:
a Collection of Resources.

getCollection

protected Collection getCollection(boolean asString)
Unify the contained Resources.
Parameters:
asString - indicates whether the resulting Collection should contain Strings instead of Resources.
Returns:
a Collection of Resources.

getInstance

public static Union getInstance(ResourceCollection rc)
Static convenience method to union an arbitrary set of Resources.
Parameters:
rc - a ResourceCollection.
Returns:
a Union.

list

public String[] list()
Returns all Resources in String format. Provided for convenience in implementing Path.
Returns:
String array of Resources.

listResources

public Resource[] listResources()
Convenience method.
Returns:
Resource[]