All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tw.edu.ncnu.im.cnclab.DataStru.Queue

java.lang.Object
   |
   +----tw.edu.ncnu.im.cnclab.DataStru.Queue

public class Queue
extends Object
The Queue class implements a circular queue.

Version:
0.2 May 10, 1999
Author:
Ding-Yi Chen

Constructor Index

 o Queue()
Constructor of queue.
 o Queue(int)
Constructor of queue.

Method Index

 o dequeue()
Removes the object at the front of this queue and returns that object as the value of this function.
 o enqueue(Object)
Put object in queue
 o isEmpty()
Tests if this queue empty.
 o peekN(int)
Looks at the object at the index i of this queue without removing it from the queue.
 o size()
Size of the queue

Constructors

 o Queue
 public Queue()
Constructor of queue. Creates a queue of DEFAULT_SIZE. (200)

 o Queue
 public Queue(int size)
Constructor of queue.

Parameters:
size - Size of queue.

Methods

 o enqueue
 public void enqueue(Object o)
Put object in queue

Parameters:
o - The object to put.
 o dequeue
 public Object dequeue()
Removes the object at the front of this queue and returns that object as the value of this function.

Returns:
The object at the front of this queue.
 o isEmpty
 public boolean isEmpty()
Tests if this queue empty.

Returns:
true if this queue empty, false if otherwise.
 o size
 public int size()
Size of the queue

Returns:
The current of the size.
 o peekN
 public Object peekN(int i)
Looks at the object at the index i of this queue without removing it from the queue.

Parameters:
i - The specified index begin at front of queue.
Returns:
the object at the inddex i of this queue.

All Packages  Class Hierarchy  This Package  Previous  Next  Index