Class FutureWrapper<V>

  • Type Parameters:
    V - The result type returned by this Future's get method.
    All Implemented Interfaces:

    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.
    Christian Fries
    • Constructor Detail

      • FutureWrapper

        public FutureWrapper​(V object)
        Create a wrapper to an object that looks like a Future on that object.
        object - Object to wrap.
    • Method Detail

      • cancel

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

        public V get()
        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>