?? queue.java
字號:
package com.deitel.jhtp5.ch20;
public class Queue{
private List queueList;
// construct queue
public Queue()
{
queueList = new List ( "queue" );
}
// add object to queue
public synchronized void enqueue ( Object object, int[] info )
{
queueList.insertAtBack( object, info );
}
// remove objct from queue
public synchronized int[] dequeue() throws EmptyListException
{
return queueList.removeFromFront();
}
// determine if queue is empty
public synchronized boolean isEmpty()
{
return queueList.isEmpty();
}
// output queue contents
public synchronized void print()
{
queueList.print();
}
public synchronized int[] getInfo()
{
return queueList.getInfo();
}
public synchronized Object getName()
{
return queueList.getName();
}
} // end class queue
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -