Merge branch 'master' of /home/sylvain/IdeaProjects/Persons_Comparator with conflicts.
[Persons_Comparator.git] / src / Region.java
index 927cffa53a15daa6d1ff67d68f54ff132e869cff..1deb36d938721e772dba6902620f455859b13f58 100644 (file)
@@ -1,38 +1,15 @@
-import com.google.gson.Gson;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.TreeMap;
 
 public class Region extends TreeMap<String, ArrayList<Country>> {
+    private List<Country> country;
 
-    public Region() {
+    public void setCountry(List<Country> origins) {
+        this.country = country;
     }
 
-    @SuppressWarnings("SpellCheckingInspection")
-    public void lectureOrigine(String continent, String pays) {
-        Gson gson = new Gson();
-        Region r = new Region();
-        String contenu = "";
-        try {
-            InputStream flux = new FileInputStream(continent + ".json");
-            InputStreamReader lecture = new InputStreamReader(flux);
-            BufferedReader buff = new BufferedReader(lecture);
-            String ligne;
-            while ((ligne = buff.readLine()) != null) {
-                contenu += ligne;
-            }
-            buff.close();
-        } catch (Exception e) {
-            System.out.println(e.toString());
-        }
-        System.out.println("les information du pays" + pays + " du fichier est : " + contenu);
-        // maintenant je veux deserialiser
-        Origin coords3 = gson.fromJson(contenu, Origin.class);
-        //Coordonnees co = gson.fromJson(json,Coordonnees.class);
-        System.out.println("Resultat = " + coords3);
+    public List<Country> getCountry() {
+        return country;
     }
 }