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:
Serializable, Iterable, Collection, List
Direct Known Subclasses:
BlockingQueue

public class Queue
extends AbstractList
implements List, Serializable

A unbounded circular 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
Queue()
          Construct a new, empty queue.
 
Method Summary
 void add(int idx, Object o)
           
 boolean add(Object o)
           
 int capacity()
          Returns the capacity of this queue.
 void clear()
          Clears this queue.
 Object element()
           
 Object first()
          Returns the first element of the queue.
 Object get(int idx)
           
 boolean isEmpty()
          Returns true if the queue is empty.
 Object last()
          Returns the last element of the queue.
 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)
           
 Object set(int idx, Object o)
           
 int size()
          Returns the number of elements in the queue.
 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 Collection
Specified by:
clear in interface List
Overrides:
clear in class AbstractList

pop

public Object pop()
Dequeues from this queue.

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

push

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


first

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

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

last

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

isEmpty

public boolean isEmpty()
Returns true if the queue is empty.

Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class AbstractCollection

size

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

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

toString

public String toString()
Overrides:
toString in class AbstractCollection

add

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

set

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

add

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

remove

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

offer

public boolean offer(Object o)

poll

public Object poll()

remove

public Object remove()

peek

public Object peek()

element

public Object element()


Copyright © 2004-2005 . All Rights Reserved.