Пример #1
0
        /// <summary>
        /// Copy constructor
        /// </summary>
        public BijectiveMap(BijectiveMap <TKey, TValue> toClone)
        {
            Contract.Requires(toClone != null);

            this.directMap  = new Dictionary <TKey, TValue>(toClone.DirectMap);
            this.inverseMap = new Dictionary <TValue, TKey>(toClone.InverseMap);
        }
Пример #2
0
        public BijectiveMap <TKey, TValue> Duplicate()
        {
            var result = new BijectiveMap <TKey, TValue>();

            foreach (var pair in this.directMap)
            {
                result[pair.Key] = pair.Value;
            }

            return(result);
        }