Exemple #1
0
        public override int GetHashCode()
        {
            var hashCode = Start.GetHashCode() ^ Chromosome.GetHashCode();

            hashCode = (hashCode * 397) ^ (AltAllele?.GetHashCode() ?? 0);
            hashCode = (hashCode * 397) ^ (AnnotationType?.GetHashCode() ?? 0);

            return(hashCode);
        }
Exemple #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Chromosome?.GetHashCode() ?? 0;
                hashCode = (hashCode * 397) ^ Start;
                hashCode = (hashCode * 397) ^ (ID?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (RefAllele?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (AltAllele?.GetHashCode() ?? 0);
                hashCode = (hashCode * 397) ^ (Gene?.GetHashCode() ?? 0);

                return(hashCode);
            }
        }
Exemple #3
0
        public override bool Equals(object other)
        {
            var otherItem = other as CustomItem;

            if (otherItem == null)
            {
                return(false);
            }

            return(Chromosome.Equals(otherItem.Chromosome) &&
                   Start.Equals(otherItem.Start) &&
                   RefAllele.Equals(otherItem.RefAllele) &&
                   AltAllele.Equals(otherItem.AltAllele) &&
                   AnnotationType.Equals(otherItem.AnnotationType));
        }
Exemple #4
0
        /// <summary>
        /// calculates the hash code for this object
        /// </summary>
        // ReSharper disable once FunctionComplexityOverflow
        private int CalculateHashCode()
        {
            var hashCode = Start.GetHashCode();

            if (Chromosome != null)
            {
                hashCode ^= Chromosome.GetHashCode();
            }
            if (ID != null)
            {
                hashCode ^= ID.GetHashCode();
            }
            if (AlleleOrigins != null)
            {
                hashCode ^= AlleleOrigins.GetHashCode();
            }
            if (AltAllele != null)
            {
                hashCode ^= AltAllele.GetHashCode();
            }
            if (MedGenIDs != null)
            {
                hashCode ^= MedGenIDs.GetHashCode();
            }
            if (OmimIDs != null)
            {
                hashCode ^= OmimIDs.GetHashCode();
            }
            if (OrphanetIDs != null)
            {
                hashCode ^= OrphanetIDs.GetHashCode();
            }
            if (Phenotypes != null)
            {
                hashCode ^= Phenotypes.GetHashCode();
            }
            if (ReferenceAllele != null)
            {
                hashCode ^= ReferenceAllele.GetHashCode();
            }
            if (Significance != null)
            {
                hashCode ^= Significance.GetHashCode();
            }
            return(hashCode);
        }