View Javadoc

1   package cz.cuni.amis.utils.future;
2   
3   /**
4    * Status of the {@link FutureWithListeners} object. It can tell you in a single enum what state the future is in.
5    * 
6    * @author Jimmy
7    */
8   public enum FutureStatus {
9   
10  	/**
11  	 * The future has not been computed yet, methods {@link FutureWithListeners#get()} and {@link FutureWithListeners#get(long, java.util.concurrent.TimeUnit)} will block.
12  	 */
13  	FUTURE_IS_BEING_COMPUTED,
14  	
15  	/**
16  	 * Future is ready, methods {@link FutureWithListeners#get()} and {@link FutureWithListeners#get(long, java.util.concurrent.TimeUnit)} won't block
17  	 * and will immediately return a result.
18  	 */
19  	FUTURE_IS_READY,
20  	
21  	/**
22  	 * The computation of the future has been canceled. The future result is (and will remain) unavailable.
23  	 */
24  	CANCELED,
25  	
26  	/**
27  	 * An exception has happenned during the future computation. The future result is (and will remain) unavailable.
28  	 */
29  	COMPUTATION_EXCEPTION;
30  
31  }