net.sf.jbaobab.expirable
Class ExpirableBlockingQueue<E>
java.lang.Object
net.sf.jbaobab.expirable.AbstractExpirableCollection<E>
net.sf.jbaobab.expirable.ExpirableCollection<E>
net.sf.jbaobab.expirable.ExpirableQueue<E>
net.sf.jbaobab.expirable.ExpirableBlockingQueue<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>
public class ExpirableBlockingQueue<E>
- extends ExpirableQueue<E>
- implements BlockingQueue<E>
An expirable decorator for a BlockingQueue.
- Author:
- Oakyoon Cha
| Methods inherited from class net.sf.jbaobab.expirable.ExpirableCollection |
add, add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface java.util.Collection |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
ExpirableBlockingQueue
public ExpirableBlockingQueue(BlockingQueue<E> queue,
long timeout)
ExpirableBlockingQueue
public ExpirableBlockingQueue(BlockingQueue<E> queue)
put
public void put(E element,
long timeout)
throws InterruptedException
- Throws:
InterruptedException
put
public void put(E element)
throws InterruptedException
- Specified by:
put in interface BlockingQueue<E>
- Throws:
InterruptedException
offer
public boolean offer(E element,
long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
offer in interface BlockingQueue<E>
- Throws:
InterruptedException
poll
public E poll(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
poll in interface BlockingQueue<E>
- Throws:
InterruptedException
take
public E take()
throws InterruptedException
- Specified by:
take in interface BlockingQueue<E>
- Throws:
InterruptedException
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacity in interface BlockingQueue<E>
drainTo
public int drainTo(Collection<? super E> collection)
- Specified by:
drainTo in interface BlockingQueue<E>
drainTo
public int drainTo(Collection<? super E> collection,
int maxElements)
- Specified by:
drainTo in interface BlockingQueue<E>