blob: d0f5ed0d430ce0bd6c9e7c40009c8ea42d65f792 (
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
|
package structure;
import java.util.ArrayList;
import java.util.HashMap;
public class Router {
private HashMap<Router,Integer> links=new HashMap<>();
public Router() {
// TODO Auto-generated constructor stub
}
public void buildLink(Router router, int weight){
this.links.put(router, weight);
router.addLink(this, weight);
}
public void addLink(Router router, int weight){
this.links.put(router, weight);
}
public int getWeight(Router router){
return this.links.get(router);
}
}
|