⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 message.java.svn-base

📁 這是一個JAVA語言寫的多代理人程式用來模擬飛機起飛或是降落的程式
💻 SVN-BASE
字号:
package gui;

public class Message {
	
	// Instance Variables
	private String to,       // the name of the agent receiving the message
	               from,     // the name of the agent sending the message
	               message;  // the message being sent to & from agents
	
	/** 
	 * Default constructor:
	 * sets all variables to empty strings
	*/
	public Message()
	{
		to = "";
		from = "";
		message = "";
	}
	
	/**
	 * Overloaded constructor:
	 * 
	 * @param   to  the name of the agent receiving the message
	 * @param   from  the name of the agent sending the message
	 * @param   message  the message being sent to & from agents
	 * @return  void
	 */
	public Message(String to, String from, String message)
	{
		this.to = to;
		this.from = from;
		this.message = message;
	}
		
	/**
	 * setter method for message (String)
	 * 
	 * @param   message  the message being sent to & from agents
	 * @return  void
	 */
	public void setMessage(String message) {
		this.message = message;
	}
	
	/**
	 * getter method for message (String)
	 * 
	 * @return  String  returns the stored message
	 */
	public String getMessage() {
		return message;
	}
	
	/**
	 * setter method for from (String)
	 * 
	 * @param   from  the name of the agent sending the message
	 * @return  void
	 */
	public void setFrom(String from) {
		this.from = from;
	}
	
	/**
	 * getter method for from (String)
	 * 
	 * @return  String  returns the stored agent's name who sent the message
	 */
	public String getFrom() {
		return from;
	}
	
	/**
	 * setter method for to (String)
	 * 
	 * @param   to  the name of the agent receiving the message
	 * @return  void
	 */
	public void setTo(String to) {
		this.to = to;
	}
	
	/**
	 * getter method for to (String)
	 * 
	 * @return  String  returns the stored agent's name who received the message
	 */
	public String getTo() {
		return to;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -