/// <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); }
public BijectiveMap <TKey, TValue> Duplicate() { var result = new BijectiveMap <TKey, TValue>(); foreach (var pair in this.directMap) { result[pair.Key] = pair.Value; } return(result); }