|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.kernel.threads.Queue
public class Queue
Bounded-capacity queue.
Field Summary | |
---|---|
(package private) int |
C
Maximum capacity of the queue. |
(package private) int |
first
Index of the first element. |
(package private) int |
n
Number of elements currently in the queue. |
(package private) int[] |
q
Pointer to an array that holds the contents. |
Constructor Summary | |
---|---|
Queue()
|
Method Summary | |
---|---|
void |
insert(int value)
Insert an integer at the end of the queue. |
boolean |
isEmpty()
Return true iff the queue is empty. |
boolean |
isFull()
Return true iff the queue is full. |
void |
Queue(int c)
Initialize a list, empty to start with. |
int |
remove()
Remove an integer from the front of the queue, returning its value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int C
int first
int n
int[] q
Constructor Detail |
---|
public Queue()
Method Detail |
---|
public void Queue(int c)
c
- The capacity of the queue.public void insert(int value)
value
- The value to insertpublic int remove()
public boolean isFull()
public boolean isEmpty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |