Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api.tasks
[Java] Interface TaskCollection

    org.gradle.api.NamedDomainObjectCollection
      org.gradle.api.NamedDomainObjectSet
          java.lang.Iterable
              org.gradle.api.tasks.TaskCollection
                  org.gradle.api.DomainObjectCollection
                      java.util.Collection

All Superinterfaces:
  NamedDomainObjectCollection, NamedDomainObjectSet, Iterable, DomainObjectCollection, Collection

    public interface TaskCollection
    extends NamedDomainObjectSet

A `TaskCollection` contains a set of Task instances, and provides a number of query methods.

Parameters:
  `` - The type of tasks which this collection contains.

Method Summary
`Object` | `getAt(String name)` {@inheritDoc}
`Object` | `getByName(String name, Closure configureClosure)` {@inheritDoc}
`Object` | `getByName(String name)` {@inheritDoc}
`TaskCollection` | `matching(Spec spec)` {@inheritDoc}
`TaskCollection` | `matching(Closure closure)` {@inheritDoc}
`Action` | `whenTaskAdded(Action action)` Adds an `Action` to be executed when a task is added to this collection.
`void` | `whenTaskAdded(Closure closure)` Adds a closure to be called when a task is added to this collection.
`TaskCollection` | `withType(Class type)` {@inheritDoc}

Methods inherited from interface NamedDomainObjectSet
findAll, matching, matching, withType

Methods inherited from interface NamedDomainObjectCollection
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRules, matching, matching, withType

Methods inherited from interface Set
add, equals, hashCode, clear, contains, isEmpty, size, toArray, toArray, addAll, iterator, remove, containsAll, removeAll, retainAll

Method Detail

### getAt

    public Object getAt(String name)

  {@inheritDoc}

### getByName

    public Object getByName(String name, Closure configureClosure)

  {@inheritDoc}

### getByName

    public Object getByName(String name)

  {@inheritDoc}

### matching

    public TaskCollection matching(Spec spec)

  {@inheritDoc}

### matching

    public TaskCollection matching(Closure closure)

  {@inheritDoc}

### whenTaskAdded

    @SuppressWarnings("UnusedDeclaration")
    public Action whenTaskAdded(Action action)

  Adds an `Action` to be executed when a task is added to this collection.
  Parameters:
    `action` - The action to be executed
  Returns:
    the supplied action

### whenTaskAdded

    @SuppressWarnings("UnusedDeclaration")
    public void whenTaskAdded(Closure closure)

  Adds a closure to be called when a task is added to this collection. The task is passed to the closure as the parameter.
  Parameters:
    `closure` - The closure to be called

### withType

    public TaskCollection withType(Class type)

  {@inheritDoc}

Gradle API 1.1-rc-1