Add an ArrayList of persons to the Person class.
[Persons_Comparator.git] / src / Firstname.java
... / ...
CommitLineData
1public class Firstname implements Comparable<Firstname> {
2 private String firstname;
3
4 Firstname() {
5 }
6
7 Firstname(String firstname) {
8 setFirstname(firstname);
9 }
10
11 public String getFirstname() {
12 return firstname;
13 }
14
15 public void setFirstname(String firstname) {
16 this.firstname = firstname;
17 }
18
19 @Override
20 public int compareTo(Firstname firstname) {
21 return LevenshteinDistance.computeLevenshteinDistance(this.getFirstname(), firstname.getFirstname());
22 }
23}