?? mmsinfolist.java
字號(hào):
package com.main.apps.message;
import java.util.Vector;
import com.main.apps.message.MMSInfo;
public class MMSInfoList
{
/**
* 線程同步控制確保模塊僅有一個(gè)實(shí)例
* @return SMSInfoList
*/
static synchronized public MMSInfoList getInstance()
{
if (instance == null)
{
instance = new MMSInfoList();
}
return instance;
}
/**
* 構(gòu)造器,默認(rèn)消息隊(duì)列長度為100
*
*/
private MMSInfoList()
{
list = new Vector(100);
}
/**
* 向消息隊(duì)列添加消息
* @param info, SMSInfo
*/
public synchronized void add(MMSInfo info)
{
list.addElement(info);
}
/**
* 返回并刪除消息隊(duì)列起始處消息,若消息隊(duì)列為空,返回空
* @return SMSInfo
*/
public synchronized MMSInfo remove()
{
if (list.size() == 0)
{
return null;
}
return (MMSInfo) list.remove(0);
}
/**
* 返回消息隊(duì)列長度
* @return Integer
*/
public int getSize()
{
return list.size();
}
/** 消息模塊實(shí)例 */
static private MMSInfoList instance;
/** 消息隊(duì)列 */
private Vector list;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -