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

public Class Union

extends BaseResourceCollectionContainer
Class Inheritance
Imports
java.util.Collection, .LinkedHashSet, .Set, java.util.function.Function, java.util.stream.Collectors, .Stream, org.apache.tools.ant.Project, org.apache.tools.ant.types.Resource, .ResourceCollection

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

Constructor Summary

AccessConstructor and Description
public
Union()

Default constructor.

public
Union(Project
owning Project
project
)

Create a new Union.

public
Union(ResourceCollection
the ResourceCollection to add.
rc
)

Convenience constructor.

public
Union(Project
owning Project
project
,
ResourceCollection
the ResourceCollection to add.
rc
)

Convenience constructor.

Method Summary

Modifier and TypeMethod and Description
protected Set<Resource>

Returns:

Set<Resource>
getAllResources
()

Get the unified set of contained Resources.

protected Collection<String>

Returns:

Collection<String>
getAllToStrings
()

Get a collection of strings representing the unified resource set (strings may duplicate).

protected Collection<Resource>

Returns:

a Collection of Resources.
getCollection
()

Implements abstract org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.getCollection.

Unify the contained Resources.
protected <
resource type
T
>
Collection<T>

Returns:

a Collection of Resources.
getCollection
(boolean
indicates whether the resulting Collection should contain Strings instead of Resources.
asString
)

Deprecated
Unify the contained Resources.
public static Union

Returns:

a Union.
getInstance
(ResourceCollection
a ResourceCollection.
rc
)

Static convenience method to union an arbitrary set of Resources.

private Union
public String[]

Returns:

String array of Resources.
list
()

Returns all Resources in String format.

public Resource[]

Returns:

Resource[]
listResources
()

Convenience method.

private Stream<? extends Resource>
private <T> Stream<? extends T>
streamResources(Function<? super Resource, ? extends T> mapper)

Inherited from org.apache.tools.ant.types.resources.BaseResourceCollectionContainer:
addaddAllclearclonedieOnCircularReferencegetResourceCollectionsisCacheisFilesystemOnlyiteratorsetCachesizetoString

Constructor Detail

Unionback to summary
public Union()

Default constructor.

Unionback to summary
public Union(Project project)

Create a new Union.

Parameters
project:Project

owning Project

Unionback to summary
public Union(ResourceCollection rc)

Convenience constructor.

Parameters
rc:ResourceCollection

the ResourceCollection to add.

Unionback to summary
public Union(Project project, ResourceCollection rc)

Convenience constructor.

Parameters
project:Project

owning Project

rc:ResourceCollection

the ResourceCollection to add.

Method Detail

getAllResourcesback to summary
protected Set<Resource> getAllResources()

Get the unified set of contained Resources.

Returns:Set<Resource>

Set<Resource>

getAllToStringsback to summary
protected Collection<String> getAllToStrings()

Get a collection of strings representing the unified resource set (strings may duplicate).

Returns:Collection<String>

Collection<String>

getCollectionback to summary
protected Collection<Resource> getCollection()

Implements abstract org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.getCollection.

Unify the contained Resources.

Returns:Collection<Resource>

a Collection of Resources.

Annotations
@Override
getCollectionback to summary
protected <T> Collection<T> getCollection(boolean asString)

Deprecated

Unify the contained Resources.

Parameters
<T>
resource type
asString:boolean

indicates whether the resulting Collection should contain Strings instead of Resources.

Returns:Collection<T>

a Collection of Resources.

Annotations
@Deprecated
@SuppressWarnings:unchecked
getInstanceback to summary
public static Union getInstance(ResourceCollection rc)

Static convenience method to union an arbitrary set of Resources.

Parameters
rc:ResourceCollection

a ResourceCollection.

Returns:Union

a Union.

getRefback to summary
private Union getRef()

Hides org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.getRef.

listback to summary
public String[] list()

Returns all Resources in String format. Provided for convenience in implementing Path.

Returns:String[]

String array of Resources.

listResourcesback to summary
public Resource[] listResources()

Convenience method.

Returns:Resource[]

Resource[]

streamResourcesback to summary
private Stream<? extends Resource> streamResources()
streamResourcesback to summary
private <T> Stream<? extends T> streamResources(Function<? super Resource, ? extends T> mapper)