Class Union
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.resources.BaseResourceCollectionContainer
org.apache.tools.ant.types.resources.Union
- All Implemented Interfaces:
Cloneable
,Iterable<Resource>
,ResourceCollection
,AppendableResourceCollection
ResourceCollection representing the union of multiple nested ResourceCollections.
- Since:
- Ant 1.7
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
ConstructorDescriptionUnion()
Default constructor.Create a new Union.Union
(Project project, ResourceCollection rc) Convenience constructor.Convenience constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the unified set of contained Resources.protected Collection<String>
Get a collection of strings representing the unified resource set (strings may duplicate).protected Collection<Resource>
Unify the contained Resources.protected <T> Collection<T>
getCollection
(boolean asString) Deprecated.static Union
Static convenience method to union an arbitrary set of Resources.String[]
list()
Returns all Resources in String format.Resource[]
Convenience method.Methods inherited from class org.apache.tools.ant.types.resources.BaseResourceCollectionContainer
add, addAll, clear, clone, dieOnCircularReference, getResourceCollections, isCache, isFilesystemOnly, iterator, setCache, size, toString
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, 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.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.apache.tools.ant.types.ResourceCollection
isEmpty, stream
-
Constructor Details
-
Union
public Union()Default constructor. -
Union
Create a new Union.- Parameters:
project
- owning Project
-
Union
Convenience constructor.- Parameters:
rc
- the ResourceCollection to add.
-
Union
Convenience constructor.- Parameters:
project
- owning Projectrc
- the ResourceCollection to add.
-
-
Method Details
-
getInstance
Static convenience method to union an arbitrary set of Resources.- Parameters:
rc
- a ResourceCollection.- Returns:
- a Union.
-
list
Returns all Resources in String format. Provided for convenience in implementing Path.- Returns:
- String array of Resources.
-
listResources
Convenience method.- Returns:
- Resource[]
-
getCollection
Unify the contained Resources.- Specified by:
getCollection
in classBaseResourceCollectionContainer
- Returns:
- a Collection of Resources.
-
getCollection
Deprecated.Unify the contained Resources.- Type Parameters:
T
- resource type- Parameters:
asString
- indicates whether the resulting Collection should contain Strings instead of Resources.- Returns:
- a Collection of Resources.
-
getAllToStrings
Get a collection of strings representing the unified resource set (strings may duplicate).- Returns:
- Collection<String>
-
getAllResources
Get the unified set of contained Resources.- Returns:
- Set<Resource>
-