net.finmath.concurrency
Class FutureWrapper<V>
- java.lang.Object
-
- net.finmath.concurrency.FutureWrapper<V>
-
- Type Parameters:
V- The result type returned by this Future's get method.
- All Implemented Interfaces:
- java.util.concurrent.Future<V>
public class FutureWrapper<V> extends java.lang.Object implements java.util.concurrent.Future<V>Implementation of the Future interface, without any concurrent execution. This wrapper comes handy, if we want to represent the result of a direct (blocking) valuation as a future to replace concurrent valuation.
-
-
Constructor Summary
Constructors Constructor and Description FutureWrapper(V object)Create a wrapper to an object that looks like a Future on that object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancancel(boolean mayInterruptIfRunning)Vget()Vget(long arg0, java.util.concurrent.TimeUnit arg1)booleanisCancelled()booleanisDone()
-
-
-
Constructor Detail
-
FutureWrapper
public FutureWrapper(V object)
Create a wrapper to an object that looks like a Future on that object.- Parameters:
object- Object to wrap.
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancelin interfacejava.util.concurrent.Future<V>
-
get
public V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Specified by:
getin interfacejava.util.concurrent.Future<V>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionException
-
get
public V get(long arg0, java.util.concurrent.TimeUnit arg1) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Specified by:
getin interfacejava.util.concurrent.Future<V>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutException
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejava.util.concurrent.Future<V>
-
isDone
public boolean isDone()
- Specified by:
isDonein interfacejava.util.concurrent.Future<V>
-
-
DataMelt 3.0 © DataMelt by jWork.ORG