Exemple #1
0
 /// <summary>
 ///     Object hash code
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = AvgMassDelta.GetHashCode();
         hashCode = (hashCode * 397) ^ Location;
         hashCode = (hashCode * 397) ^ MonoisotopicMassDelta.GetHashCode();
         hashCode = (hashCode * 397) ^ (OriginalResidue != null ? OriginalResidue.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ReplacementResidue != null ? ReplacementResidue.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemple #2
0
 /// <summary>
 ///     Object hash code
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = AvgMassDelta.GetHashCode();
         hashCode = (hashCode * 397) ^ MonoisotopicMassDelta.GetHashCode();
         hashCode = (hashCode * 397) ^ Location;
         hashCode = (hashCode * 397) ^ (Residues != null ? Residues.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CVParams != null ? CVParams.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemple #3
0
        /// <summary>
        ///     Object equality
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(SubstitutionModificationObj other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (other == null)
            {
                return(false);
            }

            if (AvgMassDelta.Equals(other.AvgMassDelta) && (Location == other.Location) &&
                MonoisotopicMassDelta.Equals(other.MonoisotopicMassDelta) &&
                (OriginalResidue == other.OriginalResidue) && (ReplacementResidue == other.ReplacementResidue))
            {
                return(true);
            }
            return(false);
        }
Exemple #4
0
        /// <summary>
        ///     Object equality
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(ModificationObj other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (other == null)
            {
                return(false);
            }

            if (AvgMassDelta.Equals(other.AvgMassDelta) &&
                MonoisotopicMassDelta.Equals(other.MonoisotopicMassDelta) && (Location == other.Location) &&
                ListUtils.ListEqualsUnOrdered(Residues, other.Residues) && Equals(CVParams, other.CVParams))
            {
                return(true);
            }
            return(false);
        }