org.apache.mina.util
Class BlockingQueue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.apache.mina.util.Queue
              extended by org.apache.mina.util.BlockingQueue
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.List

public class BlockingQueue
extends Queue

A synchronized version of Queue.

Version:
$Rev: 326586 $, $Date: 2005-10-19 17:50:29 +0200 (Wed, 19 Oct 2005) $
Author:
The Apache Directory Project (dev@directory.apache.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BlockingQueue()
           
 
Method Summary
 void add(int idx, java.lang.Object o)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection arg0)
           
 boolean addAll(int arg0, java.util.Collection arg1)
           
 int capacity()
          Returns the capacity of this queue.
 void clear()
          Clears this queue.
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection arg0)
           
 java.lang.Object element()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object first()
          Returns the first element of the queue.
 java.lang.Object get(int idx)
           
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
          Returns true if the queue is empty.
 java.util.Iterator iterator()
           
 java.lang.Object last()
          Returns the last element of the queue.
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 boolean offer(java.lang.Object o)
           
 java.lang.Object peek()
           
 java.lang.Object poll()
           
 java.lang.Object pop()
          Dequeues from this queue.
 void push(java.lang.Object obj)
          Enqueue into this queue.
 java.lang.Object remove()
           
 java.lang.Object remove(int idx)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection arg0)
           
 boolean retainAll(java.util.Collection arg0)
           
 java.lang.Object set(int idx, java.lang.Object o)
           
 int size()
          Returns the number of elements in the queue.
 java.util.List subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] arg0)
           
 java.lang.String toString()
           
 void waitForNewItem()
          Waits until any elements are in this queue.
 
Methods inherited from class java.util.AbstractList
removeRange
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockingQueue

public BlockingQueue()
Method Detail

waitForNewItem

public void waitForNewItem()
                    throws java.lang.InterruptedException
Waits until any elements are in this queue.

Throws:
java.lang.InterruptedException - if the current thread is interrupted

push

public void push(java.lang.Object obj)
Description copied from class: Queue
Enqueue into this queue.

Overrides:
push in class Queue

add

public void add(int idx,
                java.lang.Object o)
Specified by:
add in interface java.util.List
Overrides:
add in class Queue

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class Queue

addAll

public boolean addAll(int arg0,
                      java.util.Collection arg1)
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractList

addAll

public boolean addAll(java.util.Collection arg0)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.AbstractCollection

offer

public boolean offer(java.lang.Object o)
Overrides:
offer in class Queue

capacity

public int capacity()
Description copied from class: Queue
Returns the capacity of this queue.

Overrides:
capacity in class Queue

clear

public void clear()
Description copied from class: Queue
Clears this queue.

Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class Queue

first

public java.lang.Object first()
Description copied from class: Queue
Returns the first element of the queue.

Overrides:
first in class Queue
Returns:
null, if the queue is empty, or the element is really null.

get

public java.lang.Object get(int idx)
Specified by:
get in interface java.util.List
Overrides:
get in class Queue

isEmpty

public boolean isEmpty()
Description copied from class: Queue
Returns true if the queue is empty.

Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List
Overrides:
isEmpty in class Queue

last

public java.lang.Object last()
Description copied from class: Queue
Returns the last element of the queue.

Overrides:
last in class Queue
Returns:
null, if the queue is empty, or the element is really null.

pop

public java.lang.Object pop()
Description copied from class: Queue
Dequeues from this queue.

Overrides:
pop in class Queue
Returns:
null, if this queue is empty or the element is really null.

size

public int size()
Description copied from class: Queue
Returns the number of elements in the queue.

Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Overrides:
size in class Queue

toString

public java.lang.String toString()
Overrides:
toString in class Queue

remove

public java.lang.Object remove(int idx)
Specified by:
remove in interface java.util.List
Overrides:
remove in class Queue

set

public java.lang.Object set(int idx,
                            java.lang.Object o)
Specified by:
set in interface java.util.List
Overrides:
set in class Queue

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.util.AbstractList

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.util.AbstractList

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List
Overrides:
indexOf in class java.util.AbstractList

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List
Overrides:
iterator in class java.util.AbstractList

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List
Overrides:
lastIndexOf in class java.util.AbstractList

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class java.util.AbstractList

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class java.util.AbstractList

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List
Overrides:
subList in class java.util.AbstractList

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List
Overrides:
contains in class java.util.AbstractCollection

containsAll

public boolean containsAll(java.util.Collection arg0)
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List
Overrides:
containsAll in class java.util.AbstractCollection

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractCollection

removeAll

public boolean removeAll(java.util.Collection arg0)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List
Overrides:
removeAll in class java.util.AbstractCollection

retainAll

public boolean retainAll(java.util.Collection arg0)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List
Overrides:
retainAll in class java.util.AbstractCollection

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.AbstractCollection

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.AbstractCollection

element

public java.lang.Object element()
Overrides:
element in class Queue

peek

public java.lang.Object peek()
Overrides:
peek in class Queue

poll

public java.lang.Object poll()
Overrides:
poll in class Queue

remove

public java.lang.Object remove()
Overrides:
remove in class Queue