예제 #1
0
        public override int GetHashCode()
        {
            if (UniversalSubject == null)
            {
                throw new NotSupportedException("UniversalSubject not yet initialized!");
            }

            int hash = 23;

            hash = hash * 37 + PerRisk.GetHashCode();

            if ((Components == null) || (Components.Count == 0))
            {
                hash = hash * 37 + 41;
            }
            else
            {
                foreach (SymbolicValue COL in Components.Keys)
                {
                    hash = hash * 37 + COL.GetHashCode();
                    foreach (int ResolvedExposureType in Components[COL].Keys)
                    {
                        hash = hash * 37 + ResolvedExposureType.GetHashCode();
                        HashSet <long> Components_COL_ResolvedExposureType
                            = Components[COL][ResolvedExposureType].Item1;
                        foreach (long RITEId in Components_COL_ResolvedExposureType)
                        {
                            hash = hash * 37 + RITEId.GetHashCode();
                        }
                    }
                }
            }

            return(hash);
        }
예제 #2
0
        public override int GetHashCode()
        {
            if (UniversalSubject == null)
            {
                throw new NotSupportedException("UniversalSubject not yet initialized!");
            }

            int hash = 23;

            hash = hash * 37 + PerRisk.GetHashCode();

            //if ((Components == null) || (Components.Count == 0))
            //    hash = hash * 37 + 41;
            //else
            //    foreach (Tuple<int, long, SymbolicValue> Component in Components)
            //    {
            //        hash = hash * 37 + Component.Item1.GetHashCode();
            //        hash = hash * 37 + Component.Item2.GetHashCode();
            //        hash = hash * 37 + Component.Item3.GetHashCode();
            //    }

            if ((Components == null) || (Components.Count == 0))
            {
                hash = hash * 37 + 41;
            }
            else
            {
                foreach (SymbolicValue COL in Components.Keys)
                {
                    hash = hash * 37 + COL.GetHashCode();
                    foreach (int ResolvedExposureType in Components[COL].Keys)
                    {
                        hash = hash * 37 + ResolvedExposureType.GetHashCode();
                        foreach (long RITEId in Components[COL][ResolvedExposureType])
                        {
                            hash = hash * 37 + RITEId.GetHashCode();
                        }
                    }
                }
            }

            return(hash);
        }