You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
list/src/main/java/data/MultipleHMKeys3.java

49 lines
1022 B

package data;
import java.util.Objects;
/*
Created for when words are sorted by multiple keys, i.e. not just lemmas but lemmas and msd simultaneously.
*/
public final class MultipleHMKeys3 implements MultipleHMKeys {
private final String k1, k2, k3;
public MultipleHMKeys3(String k1, String k2, String k3) {
this.k1 = k1;
this.k2 = k2;
this.k3 = k3;
}
public String getK1() {
return k1;
}
public String getK2() {
return k2;
}
public String getK3() {
return k3;
}
public String getK4() {
return null;
}
public String getK5() {
return null;
}
@Override
public int hashCode() {
return Objects.hash(k1, k2, k3);
}
@Override
public boolean equals(Object obj) {
return (obj instanceof MultipleHMKeys3) && ((MultipleHMKeys3) obj).k1.equals(k1)
&& ((MultipleHMKeys3) obj).k2.equals(k2)
&& ((MultipleHMKeys3) obj).k3.equals(k3);
}
}