/// <summary> /// Promotes the key/value pairs in the current collection to the next larger /// and more complex storage model. /// </summary> public abstract void Promote(FrugalMapBase newMap);
public override void Promote(FrugalMapBase newMap) { for (int index = 0; index < _entries.Length; ++index) { if (FrugalMapStoreState.Success == newMap.InsertEntry(_entries[index].Key, _entries[index].Value)) { continue; } // newMap is smaller than previous map throw new ArgumentException(SR.Get(SRID.FrugalMap_TargetMapCannotHoldAllData, this.ToString(), newMap.ToString()), "newMap"); } }
public override void Promote(FrugalMapBase newMap) { if (FrugalMapStoreState.Success != newMap.InsertEntry(_entry0.Key, _entry0.Value)) { // newMap is smaller than previous map throw new ArgumentException(SR.Get(SRID.FrugalMap_TargetMapCannotHoldAllData, this.ToString(), newMap.ToString()), "newMap"); } if (FrugalMapStoreState.Success != newMap.InsertEntry(_entry1.Key, _entry1.Value)) { // newMap is smaller than previous map throw new ArgumentException(SR.Get(SRID.FrugalMap_TargetMapCannotHoldAllData, this.ToString(), newMap.ToString()), "newMap"); } if (FrugalMapStoreState.Success != newMap.InsertEntry(_entry2.Key, _entry2.Value)) { // newMap is smaller than previous map throw new ArgumentException(SR.Get(SRID.FrugalMap_TargetMapCannotHoldAllData, this.ToString(), newMap.ToString()), "newMap"); } }
public override void Promote(FrugalMapBase newMap) { // Should never get here throw new InvalidOperationException(SR.Get(SRID.FrugalMap_CannotPromoteBeyondHashtable)); }