org.apache.mina.util
Class Queue

java.lang.Object
  extended by org.apache.mina.util.Queue
All Implemented Interfaces:
Serializable

public class Queue
extends Object
implements Serializable

A unbounded circular queue.

Version:
$Rev: 264677 $, $Date: 2005-08-30 11:44:35 +0900 $
Author:
Trustin Lee (trustin@apache.org)
See Also:
Serialized Form

Constructor Summary
Queue()
          Construct a new, empty queue.
 
Method Summary
 int capacity()
          Returns the capacity of this queue.
 void clear()
          Clears this queue.
 Object first()
          Returns the first element of the queue.
 Object get(int idx)
           
 boolean isEmpty()
          Returns true if the queue is empty.
 Object last()
           
 Object pop()
          Dequeues from this queue.
 void push(Object obj)
          Enqueue into this queue.
 int size()
          Returns the number of elements in the queue.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.


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

get

public Object get(int idx)

isEmpty

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


size

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


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2005 . All Rights Reserved.