|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.utils.future.CombinedBooleanFuture
public class CombinedBooleanFuture
Used to combine multiple Future<Boolean> together into one Future<Boolean>.
During construction of the instance of this class you have to specify an array of booleans you want to combine - then all methods will wait for all futures to end (e.g. get(), etc.).
Note that you will probably want to use getAll() method to get respective Future results.
Constructor Summary | |
---|---|
CombinedBooleanFuture(IFuture<java.lang.Boolean>[] futures)
|
Method Summary | |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
java.lang.Boolean |
get()
Waits if necessary for the computation to complete, and then retrieves its result. |
java.lang.Boolean |
get(long timeout,
java.util.concurrent.TimeUnit unit)
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. |
java.lang.Boolean[] |
getAll(long timeout,
java.util.concurrent.TimeUnit unit)
|
java.util.concurrent.Future<java.lang.Boolean>[] |
getFutures()
|
boolean |
isCancelled()
|
boolean |
isDone()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CombinedBooleanFuture(IFuture<java.lang.Boolean>[] futures)
Method Detail |
---|
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<java.lang.Boolean>
public java.lang.Boolean get()
IFuture
get
in interface IFuture<java.lang.Boolean>
get
in interface java.util.concurrent.Future<java.lang.Boolean>
public java.lang.Boolean get(long timeout, java.util.concurrent.TimeUnit unit)
IFuture
get
in interface IFuture<java.lang.Boolean>
get
in interface java.util.concurrent.Future<java.lang.Boolean>
timeout
- the maximum time to waitunit
- the time unit of the timeout argument
public java.lang.Boolean[] getAll(long timeout, java.util.concurrent.TimeUnit unit)
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<java.lang.Boolean>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<java.lang.Boolean>
public java.util.concurrent.Future<java.lang.Boolean>[] getFutures()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |