org.apache.mina.util
Class Queue

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

public class Queue
extends java.util.AbstractList
implements java.util.List, java.io.Serializable

A unbounded circular 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
Queue()
          Construct a new, empty queue.
 
Method Summary
 void add(int idx, java.lang.Object o)
           
 boolean add(java.lang.Object o)
           
 int capacity()
          Returns the capacity of this queue.
 void clear()
          Clears this queue.
 java.lang.Object element()
           
 java.lang.Object first()
          Returns the first element of the queue.
 java.lang.Object get(int idx)
           
 boolean isEmpty()
          Returns true if the queue is empty.
 java.lang.Object last()
          Returns the last element of the queue.
 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)
           
 java.lang.Object set(int idx, java.lang.Object o)
           
 int size()
          Returns the number of elements in the queue.
 java.lang.String toString()
           
 
Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, addAll, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, subList, toArray, toArray
 

Constructor Detail

Queue

public Queue()
Construct a new, empty queue.

Method Detail

capacity

public int capacity()
Returns the capacity of this queue.


clear

public void clear()
Clears this queue.

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

pop

public java.lang.Object pop()
Dequeues from this queue.

Returns:
null, if this queue is empty or the element is really null.

push

public void push(java.lang.Object obj)
Enqueue into this queue.


first

public java.lang.Object first()
Returns the first element of the queue.

Returns:
null, if the queue is empty, or the element is really null.

last

public java.lang.Object last()
Returns the last element of the 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
Specified by:
get in class java.util.AbstractList

isEmpty

public boolean isEmpty()
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 java.util.AbstractCollection

size

public int size()
Returns the number of elements in the queue.

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

toString

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

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 java.util.AbstractList

set

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

add

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

remove

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

offer

public boolean offer(java.lang.Object o)

poll

public java.lang.Object poll()

remove

public java.lang.Object remove()

peek

public java.lang.Object peek()

element

public java.lang.Object element()