exception.unknown_annotation_detected = Unknown annotation detected: {0} {1}
exception.couldnt_store_sequence_mappings = Couldn't store sequence mappings for {0}
exception.matrix_too_many_iteration = Too many iterations in {0} (max is {1})
+exception.invalid_matrix_identifier = Name {0} not present in distance matrix.
exception.browser_not_found = Exception in finding browser: {0}
exception.browser_unable_to_locate = Unable to locate browser: {0}
exception.invocation_target_exception_creating_aedesc = InvocationTargetException while creating AEDesc: {0}
import jalview.datamodel.Sequence;
import jalview.math.MatrixI;
+import jalview.util.MessageManager;
import java.io.IOException;
import java.io.Writer;
import java.text.DecimalFormat;
import java.text.NumberFormat;
+import java.util.NoSuchElementException;
import java.util.stream.IntStream;
import org.forester.evoinference.matrix.distance.DistanceMatrix;
return identifiers[i];
}
+
@Override
public int getIndex(final String identifier)
{
+ try {
return IntStream.range(0, identifiers.length)
- .filter(x -> identifier.equals(identifiers[x])).findFirst()
- .orElse(-1);
+ .filter(x -> identifier.equals(identifiers[x])).findAny()
+ .getAsInt();
+ }
+ catch (NoSuchElementException ex) {
+ throw new Error(MessageManager.formatMessage(
+ "exception.invalid_matrix_identifier", new String[]
+ { identifier }));
+ }
}
/**