LazyResourceCollectionWrapper (Apache Ant API)

Package org.apache.tools.ant.types.resources

## Class LazyResourceCollectionWrapper

- java.lang.Object
- - org.apache.tools.ant.ProjectComponent
  - - org.apache.tools.ant.types.DataType
    - - org.apache.tools.ant.types.resources.AbstractResourceCollectionWrapper
      - - org.apache.tools.ant.types.resources.LazyResourceCollectionWrapper

- All Implemented Interfaces:
    `java.lang.Cloneable`, `java.lang.Iterable<Resource>`, `ResourceCollection`

      public class LazyResourceCollectionWrapper
      extends AbstractResourceCollectionWrapper

  Resource collection which load underlying resource collection only on demand with support for caching

- - ### 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

    Constructors
    Constructor | Description
    --- | ---
    `LazyResourceCollectionWrapper()` |

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `protected java.util.Iterator<Resource>` | `createIterator()` | Do create an iterator on the resource collection.
    `protected boolean` | `filterResource​(Resource r)` | Specify if the resource should be filtered or not.
    `protected int` | `getSize()` | Do compute the size of the resource collection.

    - ### Methods inherited from class org.apache.tools.ant.types.resources.AbstractResourceCollectionWrapper

      `add, dieOnCircularReference, getResourceCollection, isCache, isFilesystemOnly, iterator, setCache, size, toString`

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

      `checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, 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 Detail

    - #### LazyResourceCollectionWrapper

          public LazyResourceCollectionWrapper()

  - ### Method Detail

    - #### createIterator

          protected java.util.Iterator<Resource> createIterator()

      Description copied from class: `AbstractResourceCollectionWrapper`
      Do create an iterator on the resource collection. The creation of the iterator is allowed to not be thread safe whereas the iterator itself should. The returned iterator will be wrapped into the FailFast one.
      Specified by:
        `createIterator` in class `AbstractResourceCollectionWrapper`
      Returns:
        the iterator on the resource collection

    - #### getSize

          protected int getSize()

      Description copied from class: `AbstractResourceCollectionWrapper`
      Do compute the size of the resource collection. The implementation of this function is allowed to be not thread safe.
      Specified by:
        `getSize` in class `AbstractResourceCollectionWrapper`
      Returns:
        size of resource collection.

    - #### filterResource

          protected boolean filterResource​(Resource r)

      Specify if the resource should be filtered or not. This function should be overridden in order to define the filtering algorithm
      Parameters:
        `r` - resource considered for filtration
      Returns:
        whether the resource should be filtered or not