org.eclipse.net4j.util.container.delegate
Class ContainerBlockingQueue<E>

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.net4j.util.container.delegate.AbstractDelegator<E>
          extended by org.eclipse.net4j.util.container.delegate.ContainerCollection<E>
              extended by org.eclipse.net4j.util.container.delegate.ContainerQueue<E>
                  extended by org.eclipse.net4j.util.container.delegate.ContainerBlockingQueue<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>, IContainerBlockingQueue<E>, IContainerCollection<E>, IContainerQueue<E>, IContainer<E>, INotifier

public class ContainerBlockingQueue<E>
extends ContainerQueue<E>
implements IContainerBlockingQueue<E>

A default implementation of a container blocking queue.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.net4j.util.container.delegate.AbstractDelegator
AbstractDelegator.DelegatingIterator
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
IContainer.Modifiable<E>
 
Constructor Summary
ContainerBlockingQueue(BlockingQueue<E> delegate)
           
 
Method Summary
 int drainTo(Collection<? super E> c)
           
 int drainTo(Collection<? super E> c, int maxElements)
           
 BlockingQueue<E> getDelegate()
           
 boolean offer(E o, long timeout, TimeUnit unit)
           
 E poll(long timeout, TimeUnit unit)
           
 void put(E o)
           
 int remainingCapacity()
           
 E take()
           
 
Methods inherited from class org.eclipse.net4j.util.container.delegate.ContainerQueue
element, offer, peek, poll, remove
 
Methods inherited from class org.eclipse.net4j.util.container.delegate.ContainerCollection
add, addAll, clear, contains, containsAll, equals, getElements, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from class org.eclipse.net4j.util.container.delegate.AbstractDelegator
createEvent, dispatchEvent, fireAddedEvent, fireRemovedEvent
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.net4j.util.container.IContainer
getElements, isEmpty
 
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
 
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, offer, remove
 
Methods inherited from interface java.util.Queue
element, peek, poll, remove
 
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

ContainerBlockingQueue

public ContainerBlockingQueue(BlockingQueue<E> delegate)
Method Detail

getDelegate

public BlockingQueue<E> getDelegate()
Specified by:
getDelegate in interface IContainerBlockingQueue<E>
Specified by:
getDelegate in interface IContainerCollection<E>
Specified by:
getDelegate in interface IContainerQueue<E>
Overrides:
getDelegate in class ContainerQueue<E>

drainTo

public int drainTo(Collection<? super E> c)
Specified by:
drainTo in interface BlockingQueue<E>
Category
WRITE

drainTo

public int drainTo(Collection<? super E> c,
                   int maxElements)
Specified by:
drainTo in interface BlockingQueue<E>
Category
WRITE

offer

public boolean offer(E o,
                     long timeout,
                     TimeUnit unit)
              throws InterruptedException
Specified by:
offer in interface BlockingQueue<E>
Throws:
InterruptedException
Category
WRITE

poll

public E poll(long timeout,
              TimeUnit unit)
       throws InterruptedException
Specified by:
poll in interface BlockingQueue<E>
Throws:
InterruptedException
Category
WRITE

put

public void put(E o)
         throws InterruptedException
Specified by:
put in interface BlockingQueue<E>
Throws:
InterruptedException
Category
WRITE

remainingCapacity

public int remainingCapacity()
Specified by:
remainingCapacity in interface BlockingQueue<E>
Category
READ

take

public E take()
       throws InterruptedException
Specified by:
take in interface BlockingQueue<E>
Throws:
InterruptedException
Category
WRITE


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.