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:
Future<V>

public class FutureWrapper<V> extends Object implements 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.
Version:
1.0
Author:
Christian Fries
  • Constructor Details

    • 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 Details

    • cancel

      public boolean cancel(boolean mayInterruptIfRunning)
      Specified by:
      cancel in interface Future<V>
    • get

      public V get()
      Specified by:
      get in interface Future<V>
    • get

      public V get(long arg0, TimeUnit arg1)
      Specified by:
      get in interface Future<V>
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Future<V>
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface Future<V>