A lib directory to the project with gson library.
[Persons_Comparator.git] / src / Person.java
index d1ceb350724cbae919c3642f77b51fa8548278f2..3e6788ffac59805d10321c8671f96d2e8c6bf6cb 100644 (file)
@@ -1,3 +1,4 @@
+import java.util.ArrayList;
 import java.util.Comparator;
 
 public class Person implements Comparable<Person>, Comparator<Person> {
@@ -6,6 +7,8 @@ public class Person implements Comparable<Person>, Comparator<Person> {
     private Size size;
     private Weight weight;
     private Eye eye;
+    //List of persons in the database to compare to.
+    private ArrayList<Person> personArrayList;
 
     Person(Firstname firstname, Origin origin, Size size, Weight weight, Eye eye) {
         setFirstname(firstname);
@@ -55,6 +58,14 @@ public class Person implements Comparable<Person>, Comparator<Person> {
         return eye;
     }
 
+    public void setPersonArrayList(ArrayList<Person> personArrayList) {
+        this.personArrayList = personArrayList;
+    }
+
+    public ArrayList<Person> getPersonArrayList() {
+        return personArrayList;
+    }
+
     @Override
     public int compareTo(Person person) {
         return this.firstname.compareTo(person.getFirstname()) + this.origin.compareTo(person.getOrigin())