Package org.jdesktop.application

# Class TaskListener.Adapter<T,V>

java.lang.Object
org.jdesktop.application.TaskListener.Adapter<T,V>

Type Parameters:
  `T` - the result type returned by this `SwingWorker's` `doInBackground` and `get` methods
  `V` - the type used for carrying out intermediate results by this `SwingWorker's` `publish` and `process` methods

All Implemented Interfaces:
  `TaskListener<T,V>`

Enclosing interface:
  `TaskListener<T,V>`

public static class TaskListener.Adapter<T,V> extends Object implements TaskListener<T,V>
Convenience class that stubs all of the TaskListener interface methods. Using TaskListener.Adapter can simplify building TaskListeners.

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.jdesktop.application.TaskListener

`TaskListener.Adapter<T,V>`

## Constructor Summary

Constructors
Constructor
Description
`Adapter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`cancelled(TaskEvent<Void> event)`
Called after the Task's `cancelled` method is called.
`void`
`doInBackground(TaskEvent<Void> event)`
Called just before the Task's `doInBackground` method is called, i.e.
`void`
`failed(TaskEvent<Throwable> event)`
Called after the Task's `failed` completion method is called.
`void`
`finished(TaskEvent<Void> event)`
Called after the Task's `finished` method is called.
`void`
`interrupted(TaskEvent<InterruptedException> event)`
Called after the Task's `interrupted` method is called.
`void`
`process(TaskEvent<List<V>> event)`
Called each time the Task's `process` method is called.
`void`
`succeeded(TaskEvent<T> event)`
Called after the Task's `succeeded` completion method is called.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Adapter

public Adapter()

## Method Details

### doInBackground

public void doInBackground(TaskEvent<Void> event)
Description copied from interface: `TaskListener`
Called just before the Task's `doInBackground` method is called, i.e. just before the task begins running. The `event's` source is the Task and its value is null.

Specified by:
  `doInBackground` in interface `TaskListener<T,V>`
Parameters:
  `event` - a TaskEvent whose source is the `Task` object, value is null
See Also:
  - `SwingWorker.doInBackground()`
  - `EventObject.getSource()`

### process

public void process(TaskEvent<List<V>> event)
Description copied from interface: `TaskListener`
Called each time the Task's `process` method is called. The value of the event is the list of values passed to the process method.

Specified by:
  `process` in interface `TaskListener<T,V>`
Parameters:
  `event` - a TaskEvent whose source is the `Task` object and whose value is a list of the values passed to the `Task.process()` method
See Also:
  - `SwingWorker.doInBackground()`
  - `Task.process(java.util.List<V>)`
  - `EventObject.getSource()`
  - `TaskEvent.getValue()`

### succeeded

public void succeeded(TaskEvent<T> event)
Description copied from interface: `TaskListener`
Called after the Task's `succeeded` completion method is called. The event's value is the value returned by the Task's `get` method, i.e. the value that is computed by `SwingWorker.doInBackground()`.

Specified by:
  `succeeded` in interface `TaskListener<T,V>`
Parameters:
  `event` - a TaskEvent whose source is the `Task` object, and whose value is the value returned by `Task.get()`.
See Also:
  - `Task.succeeded(T)`
  - `EventObject.getSource()`
  - `TaskEvent.getValue()`

### failed

public void failed(TaskEvent<Throwable> event)
Description copied from interface: `TaskListener`
Called after the Task's `failed` completion method is called. The event's value is the Throwable passed to `Task.failed()`.

Specified by:
  `failed` in interface `TaskListener<T,V>`
Parameters:
  `event` - a TaskEvent whose source is the `Task` object, and whose value is the Throwable passed to `Task.failed()`.
See Also:
  - `Task.failed(java.lang.Throwable)`
  - `EventObject.getSource()`
  - `TaskEvent.getValue()`

### cancelled

public void cancelled(TaskEvent<Void> event)
Description copied from interface: `TaskListener`
Called after the Task's `cancelled` method is called. The `event's` source is the Task and its value is null.

Specified by:
  `cancelled` in interface `TaskListener<T,V>`
Parameters:
  `event` - a TaskEvent whose source is the `Task` object, value is null
See Also:
  - `Task.cancelled()`
  - `SwingWorker.get()`
  - `EventObject.getSource()`

### interrupted

public void interrupted(TaskEvent<InterruptedException> event)
Description copied from interface: `TaskListener`
Called after the Task's `interrupted` method is called. The `event's` source is the Task and its value is the InterruptedException passed to `Task.interrupted()`.

Specified by:
  `interrupted` in interface `TaskListener<T,V>`
Parameters:
  `event` - a TaskEvent whose source is the `Task` object, and whose value is the InterruptedException passed to `Task.interrupted()`.
See Also:
  - `Task.interrupted(java.lang.InterruptedException)`
  - `EventObject.getSource()`
  - `TaskEvent.getValue()`

### finished

public void finished(TaskEvent<Void> event)
Description copied from interface: `TaskListener`
Called after the Task's `finished` method is called. The `event's` source is the Task and its value is null.

Specified by:
  `finished` in interface `TaskListener<T,V>`
Parameters:
  `event` - a TaskEvent whose source is the `Task` object, value is null.
See Also:
  - `Task.interrupted(java.lang.InterruptedException)`
  - `EventObject.getSource()`