public abstract class

BaseCancelable

extends Object
implements Cancelable<T>
java.lang.Object
   ↳ com.cooliris.media.BaseCancelable<T>

Class Overview

An abstract class for the interface Cancelable. Subclass can simply override the execute() function to provide an implementation of Cancelable.

Summary

Public Constructors
BaseCancelable()
Public Methods
synchronized void await()
final T get()
Gets the results of this Cancelable task.
synchronized boolean requestCancel()
Requests the task to be canceled.
Protected Methods
abstract T execute()
void freeCanceledResult(T result)
Frees the result (which is not null) when the task has been canceled.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.cooliris.media.Cancelable

Public Constructors

public BaseCancelable ()

Public Methods

public synchronized void await ()

public final T get ()

Gets the results of this Cancelable task.

public synchronized boolean requestCancel ()

Requests the task to be canceled.

Returns
  • true if the task is running and has not been canceled; false otherwise

Protected Methods

protected abstract T execute ()

Throws
Exception

protected void freeCanceledResult (T result)

Frees the result (which is not null) when the task has been canceled.