-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEdge.java
More file actions
50 lines (38 loc) · 927 Bytes
/
Edge.java
File metadata and controls
50 lines (38 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package core;
//图中的所有边,包括起点,终点和节点的内容
public class Edge {
protected Edge clone() {
Edge edge=new Edge();
edge.setEdgeName(this.getEdgeName());
edge.setBeginIndex(this.getBeginIndex());
edge.setEndIndex(this.getEndIndex());
return edge;
}
public boolean equals(Object obj) {
return edgeName.equals(((Edge)obj).getEdgeName());
}
public int hashCode() {
return edgeName.hashCode();
}
private int beginIndex;
private int endIndex;
private String edgeName;
public int getBeginIndex() {
return beginIndex;
}
public String getEdgeName() {
return edgeName;
}
public int getEndIndex() {
return endIndex;
}
public void setBeginIndex(int beginIndex) {
this.beginIndex = beginIndex;
}
public void setEdgeName(String edgeName) {
this.edgeName = edgeName;
}
public void setEndIndex(int endIndex) {
this.endIndex = endIndex;
}
}