private static IDiff[] makediffs (IList original, IList [] changed, IComparer comparer, IHashCodeProvider hashcoder) { IDiff[] diffs = new IDiff[changed.Length]; for (int i = 0; i < changed.Length; i++) diffs [i] = new Diff (original, changed [i], comparer, hashcoder); return diffs; }
public Diff(IList left, IList right, IComparer comparer, IHashCodeProvider hashcoder) { this.left = left; this.right = right; this.comparer = comparer; this.hashcoder = hashcoder; init(); }
public Diff(IList left, IList right, IComparer comparer, IHashCodeProvider hashcoder) { if (left == null) throw new ArgumentNullException("left"); if (right == null) throw new ArgumentNullException("right"); this.left = left; this.right = right; this.comparer = comparer; this.hashcoder = hashcoder; init(); }
public k_HashTable(int ai_Capacity, double ad_LoadFactor, IHashCodeProvider ak_HashProvider, IComparer ak_Comparer) { if (ad_LoadFactor <= .0 || ad_LoadFactor > 1.0) throw new ArgumentException("Load factor must be greater than .0 and smaller or equal to 1.0", "ad_LoadFactor"); md_LoadFactor = ad_LoadFactor; double ld_Size = ai_Capacity/ad_LoadFactor; if (ld_Size > int.MaxValue) throw new ArgumentException("k_HashTable overflow"); int li_TableSize = FindPrimeGreater((int)ld_Size); mk_Buckets = new r_Bucket[li_TableSize]; mi_GrowSize = (md_LoadFactor < 1.0) ? (int)(md_LoadFactor * li_TableSize) : li_TableSize-1; mk_HashProvider = ak_HashProvider; mk_Comparer = ak_Comparer; mk_End = new k_PinnedBucketIterator(this, -1); }
protected NameObjectCollectionBase(int capacity, IHashCodeProvider hashProvider, IComparer comparer) { if(capacity < 0) { throw new ArgumentOutOfRangeException ("capacity", S._("ArgRange_NonNegative")); } if(hashProvider == null) { hashProvider = CaseInsensitiveHashCodeProvider.Default; } if(comparer == null) { comparer = CaseInsensitiveComparer.Default; } table = new Entry [HashTableSize]; hcp = hashProvider; cmp = comparer; entries = new ArrayList(capacity); readOnly = false; }
public ComparableHashtable(int capacity, IHashCodeProvider hcp, IComparer comparer) : base(capacity, hcp, comparer) { }
public UnitTestNameObjectCollectionBase (IHashCodeProvider provider, IComparer comparer) : base (provider, comparer) { }
/// <summary> /// Initializes a new instance of the <see cref="DataTypeBaseDictionary"/> class. /// </summary> /// <param name="codeProvider">The code provider.</param> /// <param name="comparer">The comparer.</param> public DataTypeBaseDictionary(IHashCodeProvider codeProvider, IComparer comparer) { _innerHash = new Hashtable(codeProvider, comparer); }
public UnitTestNameObjectCollectionBase(int capacity, IHashCodeProvider provider, IComparer comparer) : base(capacity, provider, comparer) { }
/// <summary> /// Initializes a new instance of 'AffixRuleCollection'. /// </summary> /// <param name="codeProvider" type="System.Collections.IHashCodeProvider"> /// <para> /// The IHashCodeProvider that supplies the hash codes for all keys in the 'AffixRuleCollection'. /// </para> /// </param> /// <param name="comparer" type="System.Collections.IComparer"> /// <para> /// The IComparer to use to determine whether two keys are equal. /// </para> /// </param> public AffixRuleCollection(IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable(codeProvider, comparer); }
public Hashtable(IHashCodeProvider hcp, IComparer comparer) : this(0, 1.0f, hcp, comparer) { }
public FrameworkInfoDictionary(int capacity, float loadFactor, IHashCodeProvider codeProvider, IComparer comparer) { _innerHash = new Hashtable (capacity, loadFactor, codeProvider, comparer); }
public NameValueCollection(IHashCodeProvider hashProvider, IComparer comparer) : base(hashProvider, comparer) { }
public virtual void OnDeserialization(object sender) { if (_keyComparer != null) { //Somebody had a dependency on this and fixed us up before the ObjectManager got to it. return; } if (_serializationInfo == null) { throw new SerializationException(); } SerializationInfo info = _serializationInfo; _serializationInfo = null; bool readOnly = false; int count = 0; string[] keys = null; object[] values = null; IHashCodeProvider hashProvider = null; IComparer comparer = null; bool hasVersion = false; int serializedVersion = 0; SerializationInfoEnumerator enumerator = info.GetEnumerator(); while (enumerator.MoveNext()) { switch (enumerator.Name) { case ReadOnlyName: readOnly = info.GetBoolean(ReadOnlyName);; break; case HashCodeProviderName: hashProvider = (IHashCodeProvider)info.GetValue(HashCodeProviderName, typeof(IHashCodeProvider));; break; case ComparerName: comparer = (IComparer)info.GetValue(ComparerName, typeof(IComparer)); break; case KeyComparerName: _keyComparer = (IEqualityComparer)info.GetValue(KeyComparerName, typeof(IEqualityComparer)); break; case CountName: count = info.GetInt32(CountName); break; case KeysName: keys = (String[])info.GetValue(KeysName, typeof(String[])); break; case ValuesName: values = (Object[])info.GetValue(ValuesName, typeof(Object[])); break; case VersionName: hasVersion = true; serializedVersion = info.GetInt32(VersionName); break; } } if (_keyComparer == null) { if (comparer == null || hashProvider == null) { throw new SerializationException(); } else { // create a new key comparer for V1 Object _keyComparer = new CompatibleComparer(hashProvider, comparer); } } if (keys == null || values == null) { throw new SerializationException(); } Reset(count); for (int i = 0; i < count; i++) { BaseAdd(keys[i], values[i]); } _readOnly = readOnly; // after collection populated if (hasVersion) { _version = serializedVersion; } }
protected NameObjectCollectionBase(int capacity, IHashCodeProvider hashProvider, IComparer comparer) { _keyComparer = new CompatibleComparer(hashProvider, comparer); Reset(capacity); }
internal CompatibleComparer(IHashCodeProvider hashCodeProvider, IComparer comparer) { _hcp = hashCodeProvider; _comparer = comparer; }
/// <summary> /// Initializes a new instance of 'AffixRuleCollection'. /// </summary> /// <param name="dictionary" type="System.Collections.IDictionary"> /// <para> /// The IDictionary to copy to a new 'AffixRuleCollection'. /// </para> /// </param> /// <param name="loadFactor" type="float"> /// <para> /// A number in the range from 0.1 through 1.0 indicating the maximum ratio of elements to buckets. /// </para> /// </param> /// <param name="codeProvider" type="System.Collections.IHashCodeProvider"> /// <para> /// The IHashCodeProvider that supplies the hash codes for all keys in the 'AffixRuleCollection'. /// </para> /// </param> /// <param name="comparer" type="System.Collections.IComparer"> /// <para> /// The IComparer to use to determine whether two keys are equal. /// </para> /// </param> public AffixRuleCollection(IDictionary dictionary, float loadFactor, IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable(dictionary, loadFactor, codeProvider, comparer); }
public NameValueCollection(int capacity, IHashCodeProvider hashProvider, IComparer comparer) { throw new NotImplementedException(); }
public ComparableHashtable(IDictionary d, IHashCodeProvider hcp, IComparer comparer) : base(d, hcp, comparer) { }
public StringIntegerHashtable(IDictionary dictionary, float loadFactor, IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable (dictionary, loadFactor, codeProvider, comparer); }
public ComparableHashtable(int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) : base(capacity, loadFactor, hcp, comparer) { }
/// <summary> /// Initializes a new instance of 'AffixRuleCollection'. /// </summary> /// <param name="capacity" type="int"> /// <para> /// The approximate number of elements that the 'AffixRuleCollection' can initially contain. /// </para> /// </param> /// <param name="loadFactor" type="float"> /// <para> /// A number in the range from 0.1 through 1.0 indicating the maximum ratio of elements to buckets. /// </para> /// </param> /// <param name="codeProvider" type="System.Collections.IHashCodeProvider"> /// <para> /// The IHashCodeProvider that supplies the hash codes for all keys in the 'AffixRuleCollection'. /// </para> /// </param> /// <param name="comparer" type="System.Collections.IComparer"> /// <para> /// The IComparer to use to determine whether two keys are equal. /// </para> /// </param> public AffixRuleCollection(int capacity, float loadFactor, IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable(capacity, loadFactor, codeProvider, comparer); }
public ReadOnlyNameValueCollection(IHashCodeProvider hcp, IComparer comp) : base(hcp, comp) { }
public IntegerHashtable(int capacity, IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable (capacity, codeProvider, comparer); }
public ComparableHashtable(IHashCodeProvider hcp, IComparer comparer) : base(hcp, comparer) { }
internal CompatibleComparer(IComparer comparer, IHashCodeProvider hashCodeProvider) { _comparer = comparer; _hcp = hashCodeProvider; }
public Hashtable(IDictionary d, IHashCodeProvider hcp, IComparer comparer) : this(d, 1.0f, hcp, comparer) { }
public ComparableHashtable(IDictionary d, float loadFactor, IHashCodeProvider hcp, IComparer comparer) : base(d, loadFactor, hcp, comparer) { }
public UnitTestNameObjectCollectionBase(IHashCodeProvider provider, IComparer comparer) : base(provider, comparer) { }
public Hashtable(int capacity, IHashCodeProvider hcp, IComparer comparer) { throw new NotImplementedException(); }
internal CompatibleComparer(IComparer comparer, IHashCodeProvider hashCodeProvider) { this._comparer = comparer; this._hcp = hashCodeProvider; }
protected NameObjectCollectionBase(IHashCodeProvider hashProvider, IComparer comparer) { _keyComparer = new CompatibleComparer( comparer, hashProvider); Reset(); }
public NameValueCollection(int capacity, IHashCodeProvider hashProvider, IComparer comparer) : base(capacity, hashProvider, comparer) { }
public UnitTestNameObjectCollectionBase (int capacity, IHashCodeProvider provider, IComparer comparer) : base (capacity, provider, comparer) { }
#pragma warning disable CS0618 // Type or member is obsolete public MyNameObjectCollection(IHashCodeProvider hashProvider, IComparer comparer) : base(hashProvider, comparer) { }
public MyNameObjectCollection(int capacity, IHashCodeProvider hashProvider, IComparer comparer) : base(capacity, hashProvider, comparer) { }
public FrameworkInfoDictionary(IDictionary dictionary, IHashCodeProvider codeProvider, IComparer comparer) { _innerHash = new Hashtable (dictionary, codeProvider, comparer); }
internal NameObjectCollectionBase(IEqualityComparer equalityComparer, IComparer comparer, IHashCodeProvider hcp) { equality_comparer = equalityComparer; m_comparer = comparer; m_hashprovider = hcp; m_readonly = false; m_defCapacity = 0; Init(); }
public Hashtable(IDictionary d, float loadFactor, IHashCodeProvider hcp, IComparer comparer) : this((d != null) ? d.Count : 0, loadFactor, hcp, comparer) { if (d == null) { throw new ArgumentNullException("d", Environment.GetResourceString("ArgumentNull_Dictionary")); } IDictionaryEnumerator enumerator = d.GetEnumerator(); while (enumerator.MoveNext()) { this.Add(enumerator.Key, enumerator.Value); } }
public Hashtable(int capacity, IHashCodeProvider hcp, IComparer comparer) : this(capacity, 1.0f, hcp, comparer) { }
public IntegerHashtable(IDictionary dictionary, IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable (dictionary, codeProvider, comparer); }
public Hashtable(IHashCodeProvider hcp, IComparer comparer) : this(1, 1.0f, hcp, comparer) { }
public StringIntegerHashtable(IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable (codeProvider, comparer); }
public Hashtable(IHashCodeProvider hcp, IComparer comparer) { }
public StringIntegerHashtable(int capacity, float loadFactor, IHashCodeProvider codeProvider, IComparer comparer) { innerHash = new Hashtable (capacity, loadFactor, codeProvider, comparer); }
public Hashtable(IDictionary d, float loadFactor, IHashCodeProvider hcp, IComparer comparer) { }
public Hashtable(int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) : this(capacity, loadFactor) { if (hcp == null && comparer == null) { this._keycomparer = null; } else { this._keycomparer = new CompatibleComparer(comparer,hcp); } }
public Hashtable(IDictionary d, IHashCodeProvider hcp, IComparer comparer) { }
public Hashtable(int capacity, IHashCodeProvider hcp, IComparer comparer) { }
public Hashtable(IDictionary d, float loadFactor, IHashCodeProvider hcp, IComparer comparer) : this((d != null ? d.Count : 0), loadFactor, hcp, comparer) { if (d==null) throw new ArgumentNullException("d", Environment.GetResourceString("ArgumentNull_Dictionary")); Contract.EndContractBlock(); IDictionaryEnumerator e = d.GetEnumerator(); while (e.MoveNext()) Add(e.Key, e.Value); }
public Hashtable(int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) { }