com.octo.android.robospice.priority
Class PausablePriorityBlockingQueue<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.PriorityBlockingQueue<T>
              extended by com.octo.android.robospice.priority.PausablePriorityBlockingQueue<T>
All Implemented Interfaces:
Serializable, Iterable<T>, Collection<T>, BlockingQueue<T>, Queue<T>

public class PausablePriorityBlockingQueue<T>
extends PriorityBlockingQueue<T>

This class is used internally. It makes testing easier. The queue will not allow to poll() or take() an element when paused.

Author:
SNI
See Also:
Serialized Form

Constructor Summary
PausablePriorityBlockingQueue()
           
 
Method Summary
 void pause()
           
 T poll()
           
 T poll(long timeout, TimeUnit unit)
           
 void resume()
           
 T take()
           
 
Methods inherited from class java.util.concurrent.PriorityBlockingQueue
add, clear, comparator, contains, drainTo, drainTo, iterator, offer, offer, peek, put, remainingCapacity, remove, size, toArray, toArray, toString
 
Methods inherited from class java.util.AbstractQueue
addAll, element, remove
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
 

Constructor Detail

PausablePriorityBlockingQueue

public PausablePriorityBlockingQueue()
Method Detail

poll

public T poll()
Specified by:
poll in interface Queue<T>
Overrides:
poll in class PriorityBlockingQueue<T>

poll

public T poll(long timeout,
              TimeUnit unit)
       throws InterruptedException
Specified by:
poll in interface BlockingQueue<T>
Overrides:
poll in class PriorityBlockingQueue<T>
Throws:
InterruptedException

take

public T take()
       throws InterruptedException
Specified by:
take in interface BlockingQueue<T>
Overrides:
take in class PriorityBlockingQueue<T>
Throws:
InterruptedException

pause

public void pause()

resume

public void resume()


Copyright © 2012-2014. All Rights Reserved.