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

📄 nodeflowstatus.java

📁 p2p仿真器。开发者可以工作在覆盖层中进行创造和测试逻辑算法或者创建和测试新的服务。PlanetSim还可以将仿真代码平稳转换为在Internet上的实验代码
💻 JAVA
字号:
package planet.results;

import planet.commonapi.Id;
/**
 * NodeFlowStaus is a class designed to keep track of flow on 
 * each node on the overlay. Hence, a flow involves to count
 * incoming, outcoming and dropped messages by the node. The
 * dropped messages are messages dropped by the node which 
 * not belong to him. 
 * @author Marc Sanchez		<marc.sanchez@estudiants.urv.es>
 */
public class NodeFlowStatus implements java.io.Serializable {
	/**
	 * Node's Id which depends on the overlay impl. 
	 * @see planet.commonapi.Id 
	 */
	private Id node;
	/**
	 * Stores the total number of incoming messages.
	 */
	private int incoming;
	/**
	 * Stores the total number of outcoming messages.
	 */
	private int outcoming;
	/**
	 * Stores the total number of dropped messages.
	 */
	private int dropped;
	
	// Constructor
	public NodeFlowStatus(Id node) {
		this.node = node;
	}
	/**
	 * Updates the number incoming messages by this node.
	 */
	public void updateIncoming() {
		incoming++;
	}
	/**
	 * Updates the number outcoming messages by this node.
	 */
	public void updateOutcoming() {
		outcoming++;
	}
	/**
	 * Updates the number of dropped messages by this node. 
	 */
	public void updateDropped() {
		dropped++;
	}
	/**
	 * @return Returns the node's Id.
	 */
	public Id getId() {
		return this.node;
	}
	/**
	 * @return Returns the number of incoming messages.
	 */
	public int getIncoming() {
		return this.incoming;
	}
	/**
	 * @return Returns the number of outcoming messages.
	 */
	public int getOutcoming() {
		return this.outcoming;
	}
	/**
	 * @return Returns the number of dropped messages.
	 */
	public int getDropped() {
		return this.dropped;
	}
}

⌨️ 快捷键说明

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