blob: 83836a0c9869494d370d3ba690289414b1b7dad9 (
plain)
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
50
51
52
53
|
package GraphElements;
public class RetweetEdge {
private UserNode to, from;
private int retweetCount;
public RetweetEdge(UserNode to, UserNode from){
this.to = to;
this.from = from;
retweetCount = 1;
}
public void incrementRTCount(){
retweetCount++;
}
public UserNode getTo() {
return to;
}
public void setTo(UserNode to) {
this.to = to;
}
public UserNode getFrom() {
return from;
}
public void setFrom(UserNode from) {
this.from = from;
}
public int getRetweetCount() {
return retweetCount;
}
public void setRetweetCount(int retweetCount) {
this.retweetCount = retweetCount;
}
public boolean equals(Object maybeEdge){
if(maybeEdge instanceof RetweetEdge){
RetweetEdge edge = (RetweetEdge) maybeEdge;
return edge.to.equals(to) && edge.from.equals(from);
}
return false;
}
public String toString(){
return from + " -> " + to;
}
public int hashCode(){
return toString().hashCode();
}
}
|