Add interface
This commit is contained in:
parent
c444380c9a
commit
622bcc5fd7
44 changed files with 1158 additions and 13 deletions
|
@ -5,11 +5,14 @@ import java.util.HashMap;
|
|||
|
||||
public class Router {
|
||||
|
||||
|
||||
private static int id=-1;
|
||||
public String name;
|
||||
private HashMap<Router,Integer> links=new HashMap<>();
|
||||
|
||||
public Router() {
|
||||
// TODO Auto-generated constructor stub
|
||||
id++;
|
||||
this.name=""+id;
|
||||
}
|
||||
|
||||
public void buildLink(Router router, int weight){
|
||||
|
@ -24,4 +27,12 @@ public class Router {
|
|||
public int getWeight(Router router){
|
||||
return this.links.get(router);
|
||||
}
|
||||
|
||||
public HashMap<Router, Integer> getLinks() {
|
||||
return links;
|
||||
}
|
||||
|
||||
public void setLinks(HashMap<Router, Integer> links) {
|
||||
this.links = links;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue