Merge branch 'develop' into task/JAL-2196pdbeProperties
[jalview.git] / src / jalview / datamodel / MappingType.java
1 package jalview.datamodel;
2
3 /**
4  * An enumeration of the kinds of mapping (from nucleotide or peptide, to
5  * nucleotide or peptide), and the corresponding word lengths
6  */
7 public enum MappingType
8 {
9   NucleotideToPeptide(3, 1)
10   {
11     @Override
12     public MappingType getInverse()
13     {
14       return PeptideToNucleotide;
15     }
16   },
17   PeptideToNucleotide(1, 3)
18   {
19     @Override
20     public MappingType getInverse()
21     {
22       return NucleotideToPeptide;
23     }
24   },
25   NucleotideToNucleotide(1, 1)
26   {
27     @Override
28     public MappingType getInverse()
29     {
30       return NucleotideToNucleotide;
31     }
32   },
33   PeptideToPeptide(1, 1)
34   {
35     @Override
36     public MappingType getInverse()
37     {
38       return PeptideToPeptide;
39     }
40   };
41
42   private int fromRatio;
43
44   private int toRatio;
45
46   private MappingType(int fromSize, int toSize)
47   {
48     fromRatio = fromSize;
49     toRatio = toSize;
50   }
51
52   public abstract MappingType getInverse();
53
54   public int getFromRatio()
55   {
56     return fromRatio;
57   }
58
59   public int getToRatio()
60   {
61     return toRatio;
62   }
63 }