--- /dev/null
+package jalview.datamodel;
+
+/**
+ * An enumeration of the kinds of mapping (from nucleotide or peptide, to
+ * nucleotide or peptide), and the corresponding word lengths
+ */
+public enum MappingType
+{
+ NucleotideToPeptide(3, 1)
+ {
+ @Override
+ public MappingType getInverse()
+ {
+ return PeptideToNucleotide;
+ }
+ },
+ PeptideToNucleotide(1, 3)
+ {
+ @Override
+ public MappingType getInverse()
+ {
+ return NucleotideToPeptide;
+ }
+ },
+ NucleotideToNucleotide(1, 1)
+ {
+ @Override
+ public MappingType getInverse()
+ {
+ return NucleotideToNucleotide;
+ }
+ },
+ PeptideToPeptide(1, 1)
+ {
+ @Override
+ public MappingType getInverse()
+ {
+ return PeptideToPeptide;
+ }
+ };
+
+ private int fromRatio;
+
+ private int toRatio;
+
+ private MappingType(int fromSize, int toSize)
+ {
+ fromRatio = fromSize;
+ toRatio = toSize;
+ }
+
+ public abstract MappingType getInverse();
+
+ public int getFromRatio()
+ {
+ return fromRatio;
+ }
+
+ public int getToRatio()
+ {
+ return toRatio;
+ }
+}