org.apache.mina.util
Class BlockingQueue

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byorg.apache.mina.util.Queue
              extended byorg.apache.mina.util.BlockingQueue
All Implemented Interfaces:
java.util.Collection, java.util.List, java.io.Serializable

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.List
Overrides:
add in class Queue

addAll

public boolean addAll(int arg0,
                      java.util.Collection arg1)

addAll

public boolean addAll(java.util.Collection arg0)

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.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.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.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)

hashCode

public int hashCode()

indexOf

public int indexOf(java.lang.Object o)

iterator

public java.util.Iterator iterator()

lastIndexOf

public int lastIndexOf(java.lang.Object o)

listIterator

public java.util.ListIterator listIterator()

listIterator

public java.util.ListIterator listIterator(int index)

subList

public java.util.List subList(int fromIndex,
                              int toIndex)

contains

public boolean contains(java.lang.Object o)

containsAll

public boolean containsAll(java.util.Collection arg0)

remove

public boolean remove(java.lang.Object o)

removeAll

public boolean removeAll(java.util.Collection arg0)

retainAll

public boolean retainAll(java.util.Collection arg0)

toArray

public java.lang.Object[] toArray()

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)

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