001 /*
002 * BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence. This should
006 * be distributed with the code. If you do not have a copy,
007 * see:
008 *
009 * http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors. These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 * http://www.biojava.org/
019 *
020 * Created on 01-21-2010
021 */
022 package org.biojava3.core.sequence.compound;
023
024 import org.biojava3.core.sequence.template.AbstractCompound;
025 import org.biojava3.core.sequence.template.Compound;
026 /**
027 * Define a codon
028 * @author Andy Yates
029 */
030 public class CodonCompound extends AbstractCompound {
031
032 private final NucleotideCompound one;
033 private final NucleotideCompound two;
034 private final NucleotideCompound three;
035 private final boolean start;
036
037 public CodonCompound(NucleotideCompound one, NucleotideCompound two,
038 NucleotideCompound three, boolean start) {
039 super(one.toString()+two.toString()+three.toString());
040 this.one = one;
041 this.two = two;
042 this.three = three;
043 this.start = start;
044 }
045
046 public boolean equalsIgnoreCase(Compound compound) {
047 if (compound == null) {
048 return false;
049 }
050 if (!(compound instanceof CodonCompound)) {
051 return false;
052 }
053 CodonCompound them = (CodonCompound) compound;
054 return toString().equalsIgnoreCase(them.toString());
055 }
056
057 public boolean equals(Object obj) {
058 if (obj == null) {
059 return false;
060 }
061 if (!(obj instanceof CodonCompound)) {
062 return false;
063 }
064 CodonCompound them = (CodonCompound)obj;
065 return toString().equals(them.toString());
066 }
067
068 public int hashCode() {
069 return toString().hashCode();
070 }
071
072 public NucleotideCompound getOne() {
073 return one;
074 }
075
076 public NucleotideCompound getTwo() {
077 return two;
078 }
079
080 public NucleotideCompound getThree() {
081 return three;
082 }
083
084 public boolean isStart() {
085 return start;
086 }
087
088 public String getDescription() {
089 // TODO Auto-generated method stub
090 return null;
091 }
092
093 public String getLongName() {
094 // TODO Auto-generated method stub
095 return null;
096 }
097
098 public Float getMolecularWeight() {
099 // TODO Auto-generated method stub
100 return null;
101 }
102
103 public String getShortName() {
104 // TODO Auto-generated method stub
105 return null;
106 }
107
108 public void setDescription(String description) {
109 // TODO Auto-generated method stub
110
111 }
112
113 public void setLongName(String longName) {
114 // TODO Auto-generated method stub
115
116 }
117
118 public void setMolecularWeight(Float molecularWeight) {
119 // TODO Auto-generated method stub
120
121 }
122
123 public void setShortName(String shortName) {
124 // TODO Auto-generated method stub
125
126 }
127
128 }