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
-
Queue()
- Constructor of queue.
-
Queue(int)
- Constructor of queue.
-
dequeue()
- Removes the object at the front of this queue and returns that object as the value of this function.
-
enqueue(Object)
- Put object in queue
-
isEmpty()
- Tests if this queue empty.
-
peekN(int)
- Looks at the object at the index
i of this queue without removing it from the queue.
-
size()
- Size of the queue
Queue
public Queue()
- Constructor of queue. Creates a queue of DEFAULT_SIZE. (200)
Queue
public Queue(int size)
- Constructor of queue.
- Parameters:
- size - Size of queue.
enqueue
public void enqueue(Object o)
- Put object in queue
- Parameters:
- o - The object to put.
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.
isEmpty
public boolean isEmpty()
- Tests if this queue empty.
- Returns:
-
true if this queue empty, false if otherwise.
size
public int size()
- Size of the queue
- Returns:
- The current of the size.
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