亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? message.java

?? 中間件開發(fā)詳細(xì)說明:清華大學(xué)J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會(huì)員下載此源碼] [成為VIP會(huì)
?? JAVA
字號(hào):
/*
 * Title:        GridSim Toolkit
 * Description:  GridSim (Grid Simulation) Toolkit for Modeling and Simulation
 *               of Parallel and Distributed Systems such as Clusters and Grids
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 *
 * $Id: Message.java,v 1.3 2006/03/22 00:51:00 anthony Exp $
 */
package gridsim.auction;
import java.util.Hashtable;

/**
 * This class represents a single message exchanged 
 * among auctioneers, bidders or sellers.
 * 
 * @author       Marcos Dias de Assuncao
 * @since        GridSim Toolkit 4.0
 * 
 * @see gridsim.auction.AuctionTags
 */
public class Message {
	private int msgID;
	private int auctionID;
	private int sourceID;
	private int destinationID;
	private Hashtable attributes;
	private int auctionProtocol;
	private double sendAt = 0.0;
		
	//used to generate an automatic id for the message 
	private static int currentID = 0;
	
	/**
	 * This tag is used as destination of messages that are broadcast 
	 */
	public static int TO_ALL_BIDDERS = -1;
	
	/**
	 * 
	 * @param auctionID
	 * @param protocol
	 */
	public Message(int auctionID,int protocol){
		msgID = Message.generateID();
		this.auctionID = auctionID;
		this.auctionProtocol = protocol;
		attributes = new Hashtable();
	}
	
	/*
	 * This method just returns a new message ID
	 */
	private synchronized static int generateID(){
		return currentID++;
	}
	
	/**
	 * Returns an attribute of the message. <br>
	 * Additional attributes may be defined to a message. 
	 * @param key the key for the attribute to be retireved
	 * @return an Object which corresponds to the required attribute
	 */
	public Object getAttribute(Object key){
		return attributes.get(key);
	}
	
	/**
	 * Sets an attribute to the message. <br>
	 * Additional attributes may be defined to a message.
	 * @param key is the key used to retrieve the attribute.
	 * @param value is the object that corresponds to the attribute.
	 * @pre key != null && value != null
	 * @return <tt>true</tt> if the attribute was set correctly
	 */
	public boolean setAttribute(Object key, Object value){
		if(key == null || value == null)
			return false;
		
		attributes.put(key, value);
		return true;
	}
	
	/*
	 * Used to clone message. 
	 */	
	protected Hashtable getAttributes(){
		return attributes;
	}
	
	/*
	 * Used to clone a message.
	 */
	protected void setAttributes(Hashtable attrib){
		attributes = attrib;
	}
	
	/**
	 * Returns the message ID
	 * @return an integer that corresponds to the message ID.
	 */
	public int getMessageID(){
		return msgID;
	}
	
	/**
	 * Sets the message ID
	 * @param id the new message ID
	 * @pre id > 0
	 * @return <tt>true</tt> if the id was properly set
	 */
	protected boolean setMessageID(int id){
		if(id <= 0)
			return false;
		this.msgID = id;
		return true;
	}
	
	/**
	 * Sets the auction ID of this message
	 * @param auctionID the ID of the auction to which the message refers
	 * @pre auctionID > 0
	 * @return <tt>true</tt> if the auctionID was properly set 
	 */
	public boolean setAuctionID(int auctionID){
		if(auctionID <= 0)
			return false;
		
		this.auctionID = auctionID;
		return true;
	}
	
	/**
	 * Retruns the auction ID of this message
	 * @return the ID of the auction to which the message refers.
	 */
	public int getAuctionID(){
		return this.auctionID;
	}
	
	/**
	 * Returns the auction protocol.
	 * @return an int which corresponds to an identification of the auction protocol
	 */
	public int getProtocol(){
		return auctionProtocol;
	}
	
	/**
	 * Sets the auction protocol used this auction
	 * @param protocol
	 * @pre protocol > 0
	 * @return <tt>true</tt> if the protocol was properly set
	 */
	public boolean setProtocol(int protocol){
		if(protocol <= 0)
			return false;
		
		this.auctionProtocol = protocol;
		return true;
	}
	
	/**
	 * Sets the the GridSim entity that generates this message 
	 * @param id the ID of an Gridsim entity
	 * @pre id == some GridSim entity's ID 
	 * @return <tt>true</tt> if the source id was properly set
	 */
	public boolean setSourceID(int id){
		if(id < 0)
			return false;
		
		this.sourceID = id;
		return true;
	}
	
	/**
	 * Returns the ID of the entity that generated the message
	 * @return an int that is a GridSim entity ID.
	 */
	public int getSourceID(){
		return sourceID;
	}
	
	/**
	 * Sets the the GridSim entity that is the recipient of this message
	 * @param id the ID of an Gridsim entity
	 * @pre id == some GridSim entity's ID
	 * @return <tt>true</tt> if the destination id was properly set
	 */
	public boolean setDestinationID(int id){
		if(id < 0)
			return false;

		destinationID = id;
		return true;
	}
	
	/**
	 * Returns the ID of the entity that is the recipient of this message
	 * @return the ID of an Gridsim entity
	 */
	public int getDestinationID(){
		return destinationID;
	}
	
	/**
	 * The message can be scheduled to be sent at a given time.
	 * This way, the entity that dispatches such a message schedules
	 * the message to be sent after the specified time
	 * @param time the time to wait to send the message
	 * @pre time >= 0.0
	 * @return <tt>true</tt> if the scheduled time was properly set
	 */
	public boolean scheduleToBeSent(double time){
		if(time < 0.0D)
			return false;
		
		sendAt = time;
		return true;
	}
	
	/**
	 * Returns how much time to waited to schedule the message
	 * @return the simulation time to wait 
	 */
	public double getScheduleTime(){
		return sendAt;
	}
	
	/**
	 * Converts message to String
	 * @return the string representation of the message 
	 */
	public String toString(){
		return "Message\n" + 
			"\tMessage ID:  " + msgID + "\n" + 
			"\tAuction ID: 	" + auctionID + "\n" +
			"\tSource:		" + sourceID + "\n" +
			"\tDestination:	" + destinationID + "\n" +
			"\tProtocol:	" + auctionProtocol + "\n";
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情伊人五月天久久综合| 欧美一级精品大片| 亚洲欧美日韩久久精品| www.日韩av| 亚洲精品成a人| 精品视频1区2区| 日产欧产美韩系列久久99| 欧美一区二区三区在线| 国产一区二区三区四| 国产视频在线观看一区二区三区 | 亚洲国产精品久久不卡毛片| 欧美日韩第一区日日骚| 青青草视频一区| 2021国产精品久久精品| 成人免费视频一区二区| 一区二区三区成人| 日韩区在线观看| 高清不卡一二三区| 一区二区三区欧美| 精品国产成人系列| 一本到一区二区三区| 久久精品国产澳门| 国产精品电影一区二区| 欧美三级在线播放| 国产99一区视频免费| 亚洲午夜免费视频| 久久网站热最新地址| 91黄视频在线| 国产精品一级在线| 午夜欧美在线一二页| 久久久久综合网| 在线观看免费亚洲| 国产精品一二三四五| 亚洲一二三级电影| 久久精品在线观看| 欧美日韩不卡在线| 国产91富婆露脸刺激对白| 一区二区三区在线影院| 国产欧美一区二区在线| 日韩欧美三级在线| 色欧美片视频在线观看在线视频| 毛片基地黄久久久久久天堂| 1000精品久久久久久久久| 91精品国产色综合久久| 91女厕偷拍女厕偷拍高清| 精品一区二区三区免费视频| 一区二区三区成人| 亚洲欧洲性图库| 亚洲精品一区二区在线观看| 欧美三片在线视频观看| 成人午夜在线视频| 激情综合色综合久久综合| 亚洲一级片在线观看| 国产精品每日更新| 国产欧美一区在线| 精品国产一区二区亚洲人成毛片 | 69p69国产精品| 色婷婷精品大在线视频| 国产suv精品一区二区883| 美女网站在线免费欧美精品| 亚洲 欧美综合在线网络| 亚洲三级在线免费| 亚洲欧洲av另类| 国产精品毛片无遮挡高清| 久久久99精品免费观看不卡| 日韩一级片在线观看| 8x福利精品第一导航| 欧美色爱综合网| 欧美午夜片在线观看| 99re热这里只有精品视频| 国产成人自拍在线| 国产乱码精品一区二区三区忘忧草| 男人的j进女人的j一区| 美女视频一区二区| 六月丁香婷婷久久| 久久99最新地址| 国产一区二区免费看| 国内成+人亚洲+欧美+综合在线| 蜜桃av一区二区在线观看| 美女视频黄免费的久久 | 激情丁香综合五月| 国内外成人在线| 国产成人综合网站| 成人久久18免费网站麻豆| 国产91精品露脸国语对白| 99在线精品免费| 色婷婷精品久久二区二区蜜臀av| 日本道精品一区二区三区| 欧美综合亚洲图片综合区| 欧美日韩美女一区二区| 欧美成人aa大片| 国产三级精品在线| 亚洲精品美国一| 日产精品久久久久久久性色| 国产呦萝稀缺另类资源| 成人一级黄色片| 欧洲一区在线电影| 日韩欧美在线影院| 欧美极品xxx| 亚洲午夜电影在线观看| 精品在线观看视频| 91在线视频网址| 欧美精品一二三区| 久久综合久久综合久久| 亚洲免费伊人电影| 五月天国产精品| 国模冰冰炮一区二区| 99国产欧美另类久久久精品| 6080yy午夜一二三区久久| 久久伊人蜜桃av一区二区| 亚洲视频综合在线| 日韩av在线发布| 岛国av在线一区| 精品视频一区二区不卡| 久久五月婷婷丁香社区| 一区二区免费看| 国产精品正在播放| 欧美卡1卡2卡| 国产精品免费视频观看| 日韩电影一区二区三区| heyzo一本久久综合| 日韩一区二区三区免费看| 中文字幕在线一区| 美女视频一区在线观看| 色噜噜久久综合| 亚洲国产激情av| 蜜臀久久99精品久久久久宅男 | 日精品一区二区三区| 国产成人在线视频网站| 欧美人xxxx| 1024成人网色www| 国产精品一二一区| 日韩一区二区三区av| 一区二区三区欧美| 成人精品小蝌蚪| 久久久综合精品| 看片网站欧美日韩| 欧美日本一区二区在线观看| 亚洲欧洲精品一区二区精品久久久| 另类专区欧美蜜桃臀第一页| 欧美亚洲自拍偷拍| 亚洲天堂成人网| 国产精品夜夜嗨| 精品国产不卡一区二区三区| 首页国产欧美日韩丝袜| 欧洲亚洲精品在线| 亚洲裸体在线观看| 成人动漫在线一区| 国产亚洲一本大道中文在线| 蜜臀av性久久久久蜜臀aⅴ流畅 | aa级大片欧美| 久久看人人爽人人| 九九在线精品视频| 日韩欧美综合在线| 麻豆成人免费电影| 日韩欧美的一区二区| 日韩高清欧美激情| 9191精品国产综合久久久久久| 亚洲一二三四在线| 色综合久久久久久久久久久| 国产精品不卡在线| 99久久精品99国产精品| 亚洲视频一区二区在线观看| 成人教育av在线| 亚洲人快播电影网| 色悠悠亚洲一区二区| 亚洲精品成人少妇| 精品视频免费看| 偷偷要91色婷婷| 欧美一区二区视频网站| 麻豆国产精品一区二区三区| 日韩欧美区一区二| 狠狠网亚洲精品| 国产色一区二区| 成人自拍视频在线观看| 中文字幕av一区二区三区免费看| 国产成人午夜视频| 日本一区二区综合亚洲| av男人天堂一区| 一区二区三区免费观看| 在线精品视频一区二区| 午夜av电影一区| 精品美女一区二区| 国产美女久久久久| 中文字幕欧美一区| 欧美日韩www| 久久国产精品99久久久久久老狼| 国产视频视频一区| 色婷婷精品久久二区二区蜜臀av| 午夜精品影院在线观看| 欧美大片在线观看| 91影院在线免费观看| 亚洲午夜久久久久中文字幕久| 欧美日韩亚洲另类| 黑人精品欧美一区二区蜜桃| 国产精品青草久久| 欧美日韩国产综合一区二区三区 | 国产精品1区2区| 一区二区三区四区精品在线视频| 宅男在线国产精品|