cz.cuni.amis.utils.future
Enum FutureStatus

java.lang.Object
  extended by java.lang.Enum<FutureStatus>
      extended by cz.cuni.amis.utils.future.FutureStatus
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FutureStatus>

public enum FutureStatus
extends java.lang.Enum<FutureStatus>

Status of the FutureWithListeners object. It can tell you in a single enum what state the future is in.


Enum Constant Summary
CANCELED
          The computation of the future has been canceled.
COMPUTATION_EXCEPTION
          An exception has happenned during the future computation.
FUTURE_IS_BEING_COMPUTED
          The future has not been computed yet, methods FutureWithListeners.get() and FutureWithListeners.get(long, java.util.concurrent.TimeUnit) will block.
FUTURE_IS_READY
          Future is ready, methods FutureWithListeners.get() and FutureWithListeners.get(long, java.util.concurrent.TimeUnit) won't block and will immediately return a result.
 
Method Summary
static FutureStatus valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FutureStatus[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FUTURE_IS_BEING_COMPUTED

public static final FutureStatus FUTURE_IS_BEING_COMPUTED
The future has not been computed yet, methods FutureWithListeners.get() and FutureWithListeners.get(long, java.util.concurrent.TimeUnit) will block.


FUTURE_IS_READY

public static final FutureStatus FUTURE_IS_READY
Future is ready, methods FutureWithListeners.get() and FutureWithListeners.get(long, java.util.concurrent.TimeUnit) won't block and will immediately return a result.


CANCELED

public static final FutureStatus CANCELED
The computation of the future has been canceled. The future result is (and will remain) unavailable.


COMPUTATION_EXCEPTION

public static final FutureStatus COMPUTATION_EXCEPTION
An exception has happenned during the future computation. The future result is (and will remain) unavailable.

Method Detail

values

public static FutureStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FutureStatus c : FutureStatus.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FutureStatus valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null