Class DefaultScheduledFuture<R>

  • Type Parameters:
    R - result type
    All Implemented Interfaces:
    java.lang.Comparable<java.util.concurrent.Delayed>, java.util.concurrent.Delayed, java.util.concurrent.Future<R>, java.util.concurrent.ScheduledFuture<R>

    public class DefaultScheduledFuture<R>
    extends java.lang.Object
    implements java.util.concurrent.ScheduledFuture<R>
    A default ScheduledFuture implementation. Useful for Scheduler implementations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cancel​(boolean mayInterruptIfRunning)  
      int compareTo​(java.util.concurrent.Delayed o)  
      R get()  
      R get​(long timeout, java.util.concurrent.TimeUnit unit)  
      long getDelay​(java.util.concurrent.TimeUnit unit)  
      boolean isCancelled()  
      boolean isDone()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultScheduledFuture

        public DefaultScheduledFuture()
    • Method Detail

      • getDelay

        public long getDelay​(java.util.concurrent.TimeUnit unit)
        Specified by:
        getDelay in interface java.util.concurrent.Delayed
        Returns:
        0
      • compareTo

        public int compareTo​(java.util.concurrent.Delayed o)
        Specified by:
        compareTo in interface java.lang.Comparable<R>
        Returns:
        0
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<R>
        Returns:
        false
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<R>
        Returns:
        false
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface java.util.concurrent.Future<R>
        Returns:
        false
      • get

        public R get()
              throws java.lang.InterruptedException,
                     java.util.concurrent.ExecutionException
        Specified by:
        get in interface java.util.concurrent.Future<R>
        Returns:
        null
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • get

        public R get​(long timeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException,
                     java.util.concurrent.ExecutionException,
                     java.util.concurrent.TimeoutException
        Specified by:
        get in interface java.util.concurrent.Future<R>
        Returns:
        null
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException