com.koushikdutta.async.future
Class SimpleCancellable

java.lang.Object
  extended by com.koushikdutta.async.future.SimpleCancellable
All Implemented Interfaces:
Cancellable, DependentCancellable
Direct Known Subclasses:
Continuation, SimpleFuture

public class SimpleCancellable
extends java.lang.Object
implements DependentCancellable


Field Summary
static Cancellable COMPLETED
           
 
Constructor Summary
SimpleCancellable()
           
 
Method Summary
 boolean cancel()
          Attempt to cancel this asynchronous operation.
protected  void cancelCleanup()
           
protected  void cleanup()
           
protected  void completeCleanup()
           
 boolean isCancelled()
          Check whether this asynchronous operation has been cancelled.
 boolean isDone()
          Check whether this asynchronous operation completed successfully.
 boolean setComplete()
           
 SimpleCancellable setParent(Cancellable parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPLETED

public static final Cancellable COMPLETED
Constructor Detail

SimpleCancellable

public SimpleCancellable()
Method Detail

isDone

public boolean isDone()
Description copied from interface: Cancellable
Check whether this asynchronous operation completed successfully.

Specified by:
isDone in interface Cancellable
Returns:

cancelCleanup

protected void cancelCleanup()

cleanup

protected void cleanup()

completeCleanup

protected void completeCleanup()

setComplete

public boolean setComplete()

cancel

public boolean cancel()
Description copied from interface: Cancellable
Attempt to cancel this asynchronous operation.

Specified by:
cancel in interface Cancellable
Returns:
The return value is whether the operation cancelled successfully.

setParent

public SimpleCancellable setParent(Cancellable parent)
Specified by:
setParent in interface DependentCancellable

isCancelled

public boolean isCancelled()
Description copied from interface: Cancellable
Check whether this asynchronous operation has been cancelled.

Specified by:
isCancelled in interface Cancellable
Returns: