diff options
| author | Loic Guegan <16000511@e003m01.istic.univ-rennes1.fr> | 2016-03-18 11:16:47 +0100 |
|---|---|---|
| committer | Loic Guegan <16000511@e003m01.istic.univ-rennes1.fr> | 2016-03-18 11:16:47 +0100 |
| commit | 622bcc5fd7cff3027a224856be4e9350e052672a (patch) | |
| tree | 65d6ea218ccd07cedaf79707a4cd197da363f007 /structure | |
| parent | c444380c9ac747385f9ebc2dbc21aeda94d38435 (diff) | |
Add interface
Diffstat (limited to 'structure')
| -rw-r--r-- | structure/Grid.java | 22 | ||||
| -rw-r--r-- | structure/Router.java | 13 |
2 files changed, 32 insertions, 3 deletions
diff --git a/structure/Grid.java b/structure/Grid.java index c7b1211..35c82f0 100644 --- a/structure/Grid.java +++ b/structure/Grid.java @@ -4,8 +4,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Random; -import javafx.util.Pair; - public class Grid { @@ -164,6 +162,26 @@ public class Grid { } } + + public ArrayList<Router> getGrid() { + return grid; + } + + + public void setGrid(ArrayList<Router> grid) { + this.grid = grid; + } + + + public ArrayList<ArrayList<Integer>> getLinks() { + return links; + } + + + public void setLinks(ArrayList<ArrayList<Integer>> links) { + this.links = links; + } + } diff --git a/structure/Router.java b/structure/Router.java index d0f5ed0..d977471 100644 --- a/structure/Router.java +++ b/structure/Router.java @@ -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; + } } |
