?? msgqueue.java
字號:
package com.gsoft.workflow.msgsender;
public class MsgQueue extends java.util.Vector {
public MsgQueue() {
super();
}
//取出隊列元素
public synchronized Object deq() {
/* 隊列若為空,引發EmptyQueueException異常 */
if( this.empty() )
throw new EmptyQueueException();
Object x = super.elementAt(0);
super.removeElementAt(0);
return x;
}
//寫入隊列元素
public synchronized void enq(Object x) {
super.addElement(x);
}
//讀取隊列第一個元素,不刪除
public synchronized Object front() {
if( this.empty() )
throw new EmptyQueueException();
return super.elementAt(0);
}
public boolean empty() {
return super.isEmpty();
}
public synchronized void clear() {
super.removeAllElements();
}
public int search(Object x) {
return super.indexOf(x);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -