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

📄 edge.java

📁 Specification File adjacencyListGragh class GeneralGraph: use adjacency list to implement the gr
💻 JAVA
字号:
package adjacencyListGragh;
/* It is a Directed Edge class,
 * because the edge is distinguish
 * it is easy to code*/
public class Edge {
	
	private Vertex origin;
	private Vertex destiny;
	private Object element;
	public boolean printed = false;
		
	public Edge(){
		this.origin = null;
		this.destiny = null;
		this.element = null;
	}
	public Edge(Object element){
		this.origin = null;
		this.destiny = null;
		this.element = element;
	}
	public Edge(Vertex origin, Vertex destiny){
		this.origin = origin;
		this.destiny = destiny;
		this.element = null;
	}
	public Edge(Vertex origin, Vertex destiny, Object element){
		this.origin = origin;
		this.destiny = destiny;
		this.element = element;
	}
	public Vertex getOriginVertex(){
		return this.origin;
	}
	public void setOriginVertex(Vertex origin){
		this.origin = origin;
	}
	public Vertex getDestinyVertex(){
		return this.destiny;
	}
	public void setDestinyVertex(Vertex destiny){
		this.destiny = destiny;
	}
	public Object getElement(){
		return this.element;
	}
	public void setElement(Object element){
		this.element = element;
	}

}

⌨️ 快捷键说明

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