diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-21 18:02:31 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-21 18:02:31 +0100 |
| commit | 0e1704bbcb3279e4779f09c06127a7c76cc8fb04 (patch) | |
| tree | f84e7d18e76df053c9bcb194da163f278873eada /structure/Router.java | |
| parent | f453154938a0e1a3ba387ff1d7c0630e54b23855 (diff) | |
Add live
Diffstat (limited to 'structure/Router.java')
| -rw-r--r-- | structure/Router.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/structure/Router.java b/structure/Router.java index d977471..fce5977 100644 --- a/structure/Router.java +++ b/structure/Router.java @@ -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; } |
