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.template;
023
024 /**
025 * The details of a Compound
026 * @author Andy Yates
027 */
028 public abstract class AbstractCompound implements Compound {
029
030 private final String base;
031 private final String upperedBase;
032 private String shortName = null;
033 private String longName = null;
034 private String description = null;
035 private Float molecularWeight = null;
036
037 public AbstractCompound(String base) {
038 this.base = base;
039 this.upperedBase = base.toUpperCase();
040 }
041
042 public String getBase() {
043 return base;
044 }
045
046 public String getUpperedBase() {
047 return upperedBase;
048 }
049
050 public String getDescription() {
051 return description;
052 }
053
054 public void setDescription(String description) {
055 this.description = description;
056 }
057
058 public String getShortName() {
059 return shortName;
060 }
061
062 public void setShortName(String shortName) {
063 this.shortName = shortName;
064 }
065
066 public String getLongName() {
067 return longName;
068 }
069
070 public void setLongName(String longName) {
071 this.longName = longName;
072 }
073
074 public Float getMolecularWeight() {
075 return molecularWeight;
076 }
077
078 public void setMolecularWeight(Float molecularWeight) {
079 this.molecularWeight = molecularWeight;
080 }
081
082 public String toString() {
083 return base;
084 }
085
086 // public boolean equals(Object obj) {
087 // if (obj == null) {
088 // return false;
089 // }
090 // if (!(obj instanceof NucleotideCompound)) {
091 // return false;
092 // }
093 // NucleotideCompound them = (NucleotideCompound) obj;
094 // return this.base.equals(them.base);
095 // }
096
097 // public int hashCode() {
098 // return this.base.hashCode();
099 // }
100
101 // public boolean equalsIgnoreCase(Compound compound) {
102 // if (compound == null) {
103 // return false;
104 // }
105 // if (!(compound instanceof NucleotideCompound)) {
106 // return false;
107 // }
108 // NucleotideCompound them = (NucleotideCompound) compound;
109 // return this.base.toString().equalsIgnoreCase(them.base.toString());
110 // }
111 }