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:
java.lang.Cloneable
,java.lang.Iterable<Resource>
,ResourceCollection
,AppendableResourceCollection
public class Union extends BaseResourceCollectionContainer
ResourceCollection representing the union of multiple nested ResourceCollections.
- Since:
- Ant 1.7
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Union()
Default constructor.Union(Project project)
Create a new Union.Union(Project project, ResourceCollection rc)
Convenience constructor.Union(ResourceCollection rc)
Convenience constructor. -
Method Summary
Modifier and Type Method Description protected java.util.Set<Resource>
getAllResources()
Get the unified set of contained Resources.protected java.util.Collection<java.lang.String>
getAllToStrings()
Get a collection of strings representing the unified resource set (strings may duplicate).protected java.util.Collection<Resource>
getCollection()
Unify the contained Resources.protected <T> java.util.Collection<T>
getCollection(boolean asString)
Deprecated.static Union
getInstance(ResourceCollection rc)
Static convenience method to union an arbitrary set of Resources.java.lang.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, 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
-
Constructor Details
-
Method Details
-
getInstance
Static convenience method to union an arbitrary set of Resources.- Parameters:
rc
- a ResourceCollection.- Returns:
- a Union.
-
list
public java.lang.String[] 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 protected <T> java.util.Collection<T> getCollection(boolean asString)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
protected java.util.Collection<java.lang.String> 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>
-