Class AbstractQueueScheduler

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractQueueScheduler​(java.util.concurrent.BlockingQueue<Job> queue)
      Constructs an instance of AbstractQueueScheduler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int drainTo​(java.util.Collection<? super Job> c)  
      int drainTo​(java.util.Collection<? super Job> c, int maxElements)  
      protected java.util.concurrent.BlockingQueue<Job> getQueue()
      Get the BlockingQueue backing this scheduler.
      Scheduler getScheduler()
      Get the scheduler to add jobs.
      java.util.Iterator<Job> iterator()  
      Job peek()  
      int remainingCapacity()  
      int size()  
      Job take()  
      • Methods inherited from class java.util.AbstractQueue

        add, addAll, clear, element, remove
      • Methods inherited from class java.util.AbstractCollection

        contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.concurrent.BlockingQueue

        add, contains, offer, offer, poll, put, remove
      • Methods inherited from interface java.util.Collection

        addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Queue

        element, poll, remove
    • Constructor Detail

      • AbstractQueueScheduler

        protected AbstractQueueScheduler​(java.util.concurrent.BlockingQueue<Job> queue)
        Constructs an instance of AbstractQueueScheduler.
        Parameters:
        queue - an instance of BlockingQueue
    • Method Detail

      • iterator

        @Nonnull
        public final java.util.Iterator<Job> iterator()
        Specified by:
        iterator in interface java.util.Collection<Job>
        Specified by:
        iterator in interface java.lang.Iterable<Job>
        Specified by:
        iterator in class java.util.AbstractCollection<Job>
      • size

        public final int size()
        Specified by:
        size in interface java.util.Collection<Job>
        Specified by:
        size in class java.util.AbstractCollection<Job>
      • take

        @Nonnull
        public final Job take()
                       throws java.lang.InterruptedException
        Specified by:
        take in interface java.util.concurrent.BlockingQueue<Job>
        Throws:
        java.lang.InterruptedException
      • remainingCapacity

        public final int remainingCapacity()
        Specified by:
        remainingCapacity in interface java.util.concurrent.BlockingQueue<Job>
      • drainTo

        public final int drainTo​(@Nonnull
                                 java.util.Collection<? super Job> c)
        Specified by:
        drainTo in interface java.util.concurrent.BlockingQueue<Job>
      • drainTo

        public final int drainTo​(@Nonnull
                                 java.util.Collection<? super Job> c,
                                 int maxElements)
        Specified by:
        drainTo in interface java.util.concurrent.BlockingQueue<Job>
      • peek

        public final Job peek()
        Specified by:
        peek in interface java.util.Queue<Job>
      • getQueue

        protected final java.util.concurrent.BlockingQueue<Job> getQueue()
        Get the BlockingQueue backing this scheduler.
        Returns:
        an instance of BlockingQueue