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:
Serializable, Iterable, Collection, List

public class BlockingQueue
extends Queue

A synchronized version of Queue.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
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, Object o)
           
 boolean add(Object o)
           
 boolean addAll(Collection arg0)
           
 boolean addAll(int arg0, Collection arg1)
           
 int capacity()
          Returns the capacity of this queue.
 void clear()
          Clears this queue.
 boolean contains(Object o)
           
 boolean containsAll(Collection arg0)
           
 Object element()
           
 boolean equals(Object o)
           
 Object first()
          Returns the first element of the queue.
 Object get(int idx)
           
 int hashCode()
           
 int indexOf(Object o)
           
 boolean isEmpty()
          Returns true if the queue is empty.
 Iterator iterator()
           
 Object last()
          Returns the last element of the queue.
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 boolean offer(Object o)
           
 Object peek()
           
 Object poll()
           
 Object pop()
          Dequeues from this queue.
 void push(Object obj)
          Enqueue into this queue.
 Object remove()
           
 Object remove(int idx)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection arg0)
           
 boolean retainAll(Collection arg0)
           
 Object set(int idx, Object o)
           
 int size()
          Returns the number of elements in the queue.
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 Object[] toArray(Object[] arg0)
           
 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 InterruptedException
Waits until any elements are in this queue.

Throws:
InterruptedException - if the current thread is interrupted

push

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

Overrides:
push in class Queue

add

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

add

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

addAll

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

addAll

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

offer

public boolean offer(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 Collection
Specified by:
clear in interface List
Overrides:
clear in class Queue

first

public 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 Object get(int idx)
Specified by:
get in interface 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 Collection
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class Queue

last

public 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 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 Collection
Specified by:
size in interface List
Overrides:
size in class Queue

toString

public String toString()
Overrides:
toString in class Queue

remove

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

set

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

equals

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

hashCode

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

indexOf

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

iterator

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

lastIndexOf

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

listIterator

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

listIterator

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

subList

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

contains

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

containsAll

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

remove

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

removeAll

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

retainAll

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

toArray

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

toArray

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

element

public Object element()
Overrides:
element in class Queue

peek

public Object peek()
Overrides:
peek in class Queue

poll

public Object poll()
Overrides:
poll in class Queue

remove

public Object remove()
Overrides:
remove in class Queue


Copyright © 2004-2005 . All Rights Reserved.