package main;

public class Person implements Comparable<Person> {

	public int id;
	public int age;
	public double length;
	public double weight;
	public double cosineScore;

	public Person(int id, int age, int length, int weight){
		this.id = id;
		this.age = age;
		this.length = length;
		this.weight = weight;
		this.cosineScore = -1;
	}
	
	public String toString(){
		return "id: " + this.id + ", age: " + this.age + ", length: " + this.length + ", weight: " + this.weight +", cosineScore: "+ this.cosineScore + "\n";
	}

	public double[] toArray(){
		double [] arr = new double[3];
		arr[0] = age;
		arr[1] = length;
		arr[2] = weight;
		return arr;
	}

	public int compareTo(Person other){
		if (this.cosineScore < other.cosineScore) return -1;
		else if (this.cosineScore > other.cosineScore) return 1;
		return 0;
	}
}

@@ -8,16 +8,243 @@
  main;%0A%0A
+/**%0A * Person class that represent the data stored in the%0A * persons table in the database.%0A * %0A * Also implements comparable based on the cosine similarity%0A * The cosine score is calculated with the CosineSimilarity class%0A */%0A
 public c
@@ -744,24 +744,215 @@
 + %22%5Cn%22;%0A%09%7D%0A%0A
+%09/**%0A%09 * Creates and double%5B%5D array with the following scheme:%0A%09 * %09%09Index 0: age%0A%09 * %09%09Index 1: length%0A%09 * %09%09Index 2: weight%0A%09 * %0A%09 * @return double%5B%5D array with age, length and weight%0A%09 */%0A
 %09public doub
@@ -1072,16 +1072,84 @@
 rr;%0A%09%7D%0A%0A
+%09/**%0A%09 * Compares two Person object based on the cosine score.%0A%09 */%0A
 %09public 

Add comments for Person class