/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (PeptideSequence != null ? PeptideSequence.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Modifications != null ? Modifications.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SubstitutionModifications != null ? SubstitutionModifications.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UserParams != null ? UserParams.GetHashCode() : 0); return(hashCode); } }
public bool Equals(TargetPeptide obj) { if (!PeptideMass.Equals(obj.PeptideMass) || !PeptideSequence.Equals(obj.PeptideSequence) || !Modifications.Count.Equals(obj.Modifications.Count) || !IdentifiedPeptide.Equals(obj.IdentifiedPeptide)) { return(false); } foreach (string key in obj.Modifications.Keys) { if (obj.Modifications[key] != Modifications[key]) { return(false); } } return(true); }
public override int GetHashCode() { int hashcode = PeptideMass.GetHashCode() * PeptideSequence.GetHashCode(); return(hashcode); }