Class sun.server.misc.Queue
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.misc.Queue

java.lang.Object
   |
   +----sun.server.misc.Queue

public class Queue
extends Object
This class implements a simple queue.

Variable Index

 o data
The queue data.
 o i
Index of head and tail of queue, respectively.
 o j
Index of head and tail of queue, respectively.
 o len
Current number of items in the queue.

Constructor Index

 o Queue(int)
Creates a queue with the specified size.

Method Index

 o add(Object)
Adds an item to the queue.
 o empty()
Returns true if the queue is empty.
 o full()
Returns true if the queue is full.
 o remove()
Removes an item from the queue.

Variables

 o data
  protected Object data[]
The queue data.
 o i
  protected int i
Index of head and tail of queue, respectively.
 o j
  protected int j
Index of head and tail of queue, respectively.
 o len
  protected int len
Current number of items in the queue.

Constructors

 o Queue
  public Queue(int size)
Creates a queue with the specified size.

Methods

 o add
  public synchronized void add(Object obj) throws QueueFullException
Adds an item to the queue.
Parameters:
obj - the object to be added to the head of the queue
Throws: QueueFullException
If the queue is full.
 o remove
  public synchronized Object remove() throws QueueEmptyException
Removes an item from the queue.
Returns:
the object removed from the tail of the queue
Throws: QueueEmptyException
If the queue is empty.
 o empty
  public synchronized boolean empty()
Returns true if the queue is empty.
 o full
  public synchronized boolean full()
Returns true if the queue is full.

All Packages  Class Hierarchy  This Package  Previous  Next  Index