예제 #1
0
        /// <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);
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        public override int GetHashCode()
        {
            int hashcode = PeptideMass.GetHashCode() * PeptideSequence.GetHashCode();

            return(hashcode);
        }