This commit is contained in:
manzerbredes 2016-03-21 18:02:31 +01:00
parent f453154938
commit 0e1704bbcb
4 changed files with 71 additions and 21 deletions
structure

View file

@ -15,7 +15,15 @@ public class Router {
this.name=""+id;
}
public void resetLinks(){
this.links=new HashMap<>();
}
public void buildLink(Router router, int weight){
this.links.remove(router);
router.removeLink(this);
this.links.put(router, weight);
router.addLink(this, weight);
}
@ -32,6 +40,10 @@ public class Router {
return links;
}
public void removeLink(Router router){
this.links.remove(router);
}
public void setLinks(HashMap<Router, Integer> links) {
this.links = links;
}