net.sf.jbaobab.expirable
Class ExpirableQueue<E>

java.lang.Object
  extended by net.sf.jbaobab.expirable.AbstractExpirableCollection<E>
      extended by net.sf.jbaobab.expirable.ExpirableCollection<E>
          extended by net.sf.jbaobab.expirable.ExpirableQueue<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Queue<E>
Direct Known Subclasses:
ExpirableBlockingQueue

public class ExpirableQueue<E>
extends ExpirableCollection<E>
implements Queue<E>

An expirable decorator for a Queue.

Author:
Oakyoon Cha

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.jbaobab.expirable.ExpirableCollection
ExpirableCollection.InternalRemoverImpl<E>
 
Field Summary
 
Fields inherited from class net.sf.jbaobab.expirable.AbstractExpirableCollection
expirer, remover, timeout
 
Constructor Summary
ExpirableQueue(Queue<E> queue)
           
ExpirableQueue(Queue<E> queue, long timeout)
           
 
Method Summary
 E element()
           
 boolean offer(E element)
           
 E peek()
           
 E poll()
           
 E remove()
           
 
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 class net.sf.jbaobab.expirable.AbstractExpirableCollection
finalize, getHandler, setHandler, timeout, timeout
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

ExpirableQueue

public ExpirableQueue(Queue<E> queue,
                      long timeout)

ExpirableQueue

public ExpirableQueue(Queue<E> queue)
Method Detail

offer

public boolean offer(E element)
Specified by:
offer in interface Queue<E>

poll

public E poll()
Specified by:
poll in interface Queue<E>

remove

public E remove()
Specified by:
remove in interface Queue<E>

peek

public E peek()
Specified by:
peek in interface Queue<E>

element

public E element()
Specified by:
element in interface Queue<E>