Browse Source

ajout Relation entre Zone Et FAI

Martin Passard 7 years ago
parent
commit
dc2699fc0a
2 changed files with 22 additions and 2 deletions
  1. 19 2
      src/data/CoveredAreas.java
  2. 3 0
      src/data/ISP.java

+ 19 - 2
src/data/CoveredAreas.java

@@ -7,19 +7,28 @@ public class CoveredAreas {
 
 	private final List<TechnoCoverage> technos;
 	private final String name;
+	private ISP isp;
 	
-	public CoveredAreas(String name, List<TechnoCoverage> techno) {
+	public CoveredAreas(String name, ISP isp, List<TechnoCoverage> techno) {
 		technos=techno;
 		this.name=name;
+		this.isp = isp;
 		
 	}
-	public CoveredAreas(String name, TechnoCoverage...techno) {
+	
+	public CoveredAreas(String name, List<TechnoCoverage> techno) {
+		this(name,null,techno);
+	}
+	
+	public CoveredAreas(String name, ISP isp, TechnoCoverage...techno) {
 		ArrayList<TechnoCoverage> l = new ArrayList<>();
 		for(int i=0;i<techno.length;++i) {
 			l.add(techno[i]);
 		}
 		this.technos=l;
 		this.name=name;
+		this.isp=isp;
+		
 		
 	}
 	
@@ -38,9 +47,17 @@ public class CoveredAreas {
 		for (TechnoCoverage tc: technos) {
 			res+=tc+" ";
 		}
+		res+="par "+isp.getBetterName();
 		
 		return res;
 	}
+	public ISP getIsp() {
+		return isp;
+	}
+	public void setIsp(ISP isp) {
+		this.isp = isp;
+	}
+	
 	
 	
 

+ 3 - 0
src/data/ISP.java

@@ -28,6 +28,9 @@ public class ISP implements AffichableSurIRC {
 		this.last_update = last_update;
 		this.data = data;
 		this.coveredAreas = ca;
+		for(int i=0; i<coveredAreas.length;++i) {
+			coveredAreas[i].setIsp(this);
+		}
 	}
 	
 	public String getShortestName() {