All Packages Class Hierarchy This Package Previous Next Index
Class sun.servlet.util.Queue
java.lang.Object
|
+----sun.servlet.util.Queue
- public class Queue
- extends Object
This class implements a simple FIFO queue with fixed size. It is unlocked
for added efficiency.
-
data
- The queue data.
-
i
- Index of head and tail of queue, respectively.
-
j
- Index of head and tail of queue, respectively.
-
len
- Current number of items in the queue.
-
Queue(int)
- Creates a queue with the specified size.
-
add(Object)
- Adds an object to the head of the queue.
-
empty()
- Returns true if the queue is empty.
-
full()
- Returns true if the queue is full.
-
remove()
- Removes an item from the tail of the queue.
data
protected Object data[]
- The queue data.
i
protected int i
- Index of head and tail of queue, respectively.
j
protected int j
- Index of head and tail of queue, respectively.
len
protected int len
- Current number of items in the queue.
Queue
public Queue(int size)
- Creates a queue with the specified size.
add
public void add(Object obj) throws QueueFullException
- Adds an object to the head of the queue.
- Parameters:
- obj - the object to be added
- Throws: QueueFullException
- if the queue was full
remove
public Object remove() throws QueueEmptyException
- Removes an item from the tail of the queue.
- Returns:
- the object to be removed
- Throws: QueueEmptyException
- if the queue was empty
empty
public boolean empty()
- Returns true if the queue is empty.
full
public boolean full()
- Returns true if the queue is full.
All Packages Class Hierarchy This Package Previous Next Index