public void removePeptide(Peptide pep) { if (peptides.Values.Contains(pep)) { peptides.Remove(pep.getSequence()); } }
public bool Equals(Object o) { // If the object is compared with itself then return true if (o == this) { return(true); } /* * Check if o is an instance of Peptide or not "null instanceof [type]" also * returns false */ if (!(o is Peptide)) { return(false); } // typecast o to Complex so that we can compare data members Peptide pep = (Peptide)o; // Compare the data members and return accordingly return(pep.getMass().CompareTo(this.getMass()) == 0 && this.getSequence().Equals(pep.getSequence())); }