list/src/main/java/data/MultipleHMKeys.java

60 lines
1.9 KiB
Java
Raw Normal View History

package data;
import java.util.ArrayList;
import java.util.Objects;
/*
Created for when words are sorted by multiple keys, i.e. not just lemmas but lemmas and msd simultaneously.
*/
2018-08-09 07:21:06 +00:00
public interface MultipleHMKeys {
String getK1();
default String getK2(){ return null; }
default String getK3(){ return null; }
default String getK4(){ return null; }
default String getK5(){ return null; }
default ArrayList<MultipleHMKeys> getSplittedMultipleHMKeys(){ return null; }
default String getMsd(Filter filter) {
String msd = "";
if (filter.getCalculateFor().equals(CalculateFor.MORPHOSYNTACTIC_SPECS)){
msd = getK1();
} else if (filter.getMultipleKeys().contains(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
int i = 0;
for (CalculateFor otherKey : filter.getMultipleKeys()) {
switch (i) {
case 0:
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
msd = getK2();
}
break;
case 1:
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
msd = getK3();
}
break;
case 2:
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
msd = getK4();
}
break;
case 3:
if (otherKey.equals(CalculateFor.MORPHOSYNTACTIC_SPECS)) {
msd = getK5();
}
break;
}
i++;
}
}
return msd;
}
@Override
2018-08-09 07:21:06 +00:00
int hashCode();
@Override
2018-08-09 07:21:06 +00:00
boolean equals(Object obj);
}