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

📄 nodeproperties.java

📁 p2p仿真
💻 JAVA
字号:
/** * @(#)NodeProperties.java	ver 1.2  6/20/2005 * * Modified by Weishuai Yang (wyang@cs.binghamton.edu).  *  * this file is based on KOM / LetsQoS Topology Conversion Tools */package gps.network.graph;/** * Stores the Properties of a node * @author Oliver Heckmann */public class NodeProperties {    /**     * node type - LAN_NODE     */	public final static int LAN_NODE = 1;    /**     * node type - MAN_NODE     */	public final static int MAN_NODE = 2;    /**     * node type - WAN_NODE     */	public final static int WAN_NODE = 4;    /**     * node type - EDGE_NODE     */	public final static int EDGE_NODE = 8;    /**     * node type - CORE_NODE     */	public final static int CORE_NODE = 16;	/** x position*/	protected double x;	/** y position*/	protected double y;	/** node type*/	protected int type;	/** node label */	protected String label;	/** traffic*/	protected String traffic;	/** 	 * Creates new NodeProperties 	 */	public NodeProperties() {	}	/**	 * Creates new NodeProperties	 * @param x x position	 * @param y y position	 */	public NodeProperties(double x, double y) {		this.x = x;		this.y = y;	}	/**	 * Creates new NodeProperties	 * @param x x position	 * @param y y position	 * @param type node type	 */	public NodeProperties(double x, double y, int type) {		this.x = x;		this.y = y;		this.type = type;	}	/**	 * Creates new NodeProperties	 * @param type node type	 */	public NodeProperties(int type) {		this.type = type;	}		/**	 * gets x position	 * @return double x-position	 */	public double getX() {		return x;	}	/**	 * gets y position	 * @return double y-position	 */	public double getY() {		return y;	}	/**	 * sets x position	 * @param x new x	 */	public void setX(double x) {		this.x = x;	}	/**	 * sets y position	 * @param y new y	 */	public void setY(double y) {		this.y = y;	}	/**	 * gets node type	 * @return node type	 */	public int getType() {		return type;	}	/**	 * sets node type	 * @param type new type	 */	public void setType(int type) {		this.type = type;	}	/**	 * gets node lable	 * @return labe string	 */	public String getLabel() {		return label;	}	/**	 * sets lable for this node	 * @param label new lable	 */	public void setLabel(String label) {		this.label = label;	}	/**	 * gets traffic	 * @return traffic	 */	public String getTraffic() {		return traffic;	}	/**	 * sets traffic	 * @param traffic new traffic	 */	public void setTraffic(String traffic) {		this.traffic = traffic;	}	/**	 * copy node properties to another node	 * @param to properties of another node	 */	protected void copyTo(NodeProperties to) {		to.x = x;		to.y = y;		to.type = type;	}}

⌨️ 快捷键说明

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