亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? multidictionary.cs

?? C#寫的類似于STL的集合類,首先是C#編寫,可以用于.net變程.
?? CS
?? 第 1 頁 / 共 2 頁
字號:
                    // Value was not found.
                    return false;
                }
            }
            else {
                return false;         // key not found.
            }
        }


        /// <summary>
        /// Removes a key and all associated values from the dictionary. If the
        /// key is not present in the dictionary, it is unchanged and false is returned.
        /// </summary>
        /// <param name="key">The key to remove.</param>
        /// <returns>True if the key was present and was removed. Returns 
        /// false if the key was not present.</returns>
        public sealed override bool Remove(TKey key)
        {
            KeyAndValues dummy;
            return hash.Delete(new KeyAndValues(key), out dummy);
        }

        /// <summary>
        /// Removes all keys and values from the dictionary.
        /// </summary>
        public sealed override void Clear()
        {
            hash.StopEnumerations();  // Invalidate any enumerations.

            // The simplest and fastest way is simply to throw away the old hash and create a new one.
            hash = new Hash<KeyAndValues>(equalityComparer);
        }

        #endregion Add or remove items

        #region Query items

        /// <summary>
        /// Returns the IEqualityComparer&lt;T&gt; used to compare keys in this dictionary. 
        /// </summary>
        /// <value>If the dictionary was created using a comparer, that comparer is returned. Otherwise
        /// the default comparer for TKey (EqualityComparer&lt;TKey&gt;.Default) is returned.</value>
        public IEqualityComparer<TKey> KeyComparer
        {
            get
            {
                return this.keyEqualityComparer;
            }
        }

        /// <summary>
        /// Returns the IEqualityComparer&lt;T&gt; used to compare values in this dictionary. 
        /// </summary>
        /// <value>If the dictionary was created using a comparer, that comparer is returned. Otherwise
        /// the default comparer for TValue (EqualityComparer&lt;TValue&gt;.Default) is returned.</value>
        public IEqualityComparer<TValue> ValueComparer
        {
            get
            {
                return this.valueEqualityComparer;
            }
        }

        /// <summary>
        /// Determine if two values are equal.
        /// </summary>
        /// <param name="value1">First value to compare.</param>
        /// <param name="value2">Second value to compare.</param>
        /// <returns>True if the values are equal.</returns>
        protected sealed override bool EqualValues(TValue value1, TValue value2)
        {
            return valueEqualityComparer.Equals(value1, value2);
        }

        /// <summary>
        /// Gets the number of key-value pairs in the dictionary. Each value associated
        /// with a given key is counted. If duplicate values are permitted, each duplicate
        /// value is included in the count.
        /// </summary>
        /// <value>The number of key-value pairs in the dictionary.</value>
        public sealed override int Count
        {
            get
            {
                return hash.ElementCount;
            }
        }

        /// <summary>
        /// Checks to see if <paramref name="value"/> is associated with <paramref name="key"/>
        /// in the dictionary.
        /// </summary>
        /// <param name="key">The key to check.</param>
        /// <param name="value">The value to check.</param>
        /// <returns>True if <paramref name="value"/> is associated with <paramref name="key"/>.</returns>
        public sealed override bool Contains(TKey key, TValue value)
        {
            KeyAndValues find = new KeyAndValues(key);
            KeyAndValues item;
            if (hash.Find(find, false, out item)) {
                int existingCount = item.Count;
                int valueHash = Util.GetHashCode(value, valueEqualityComparer);
                for (int i = 0; i < existingCount; ++i) {
                    if (Util.GetHashCode(item.Values[i], valueEqualityComparer) == valueHash &&
                        valueEqualityComparer.Equals(item.Values[i], value)) {
                        // Found an equal existing value. 
                        return true;
                    }
                }
            }
            
            return false;
        }

        /// <summary>
        /// Checks to see if the key is present in the dictionary and has
        /// at least one value associated with it.
        /// </summary>
        /// <param name="key">The key to check.</param>
        /// <returns>True if <paramref name="key"/> is present and has at least
        /// one value associated with it. Returns false otherwise.</returns>
        public sealed override bool ContainsKey(TKey key)
        {
            KeyAndValues find = new KeyAndValues(key);
            KeyAndValues temp;
            return hash.Find(find, false, out temp);
        }

        /// <summary>
        /// Enumerate all the keys in the dictionary. 
        /// </summary>
        /// <returns>An IEnumerator&lt;TKey&gt; that enumerates all of the keys in the dictionary that
        /// have at least one value associated with them.</returns>
        protected sealed override IEnumerator<TKey> EnumerateKeys()
        {
            foreach (KeyAndValues item in hash) {
                yield return item.Key;
            }
        }

        /// <summary>
        ///  Enumerate the values in the a KeyAndValues structure. Can't return
        /// the array directly because:
        ///   a) The array might be larger than the count.
        ///   b) We can't allow clients to down-cast to the array and modify it.
        ///   c) We have to abort enumeration if the hash changes.
        /// </summary>
        /// <param name="keyAndValues">Item with the values to enumerate..</param>
        /// <returns>An enumerable that enumerates the items in the KeyAndValues structure.</returns>
        private IEnumerator<TValue> EnumerateValues(KeyAndValues keyAndValues)
        {
            int count = keyAndValues.Count;
            int stamp = hash.GetEnumerationStamp();

            for (int i = 0; i < count; ++i) {
                yield return keyAndValues.Values[i];
                hash.CheckEnumerationStamp(stamp);
            }
        }

        /// <summary>
        /// Determines if this dictionary contains a key equal to <paramref name="key"/>. If so, all the values
        /// associated with that key are returned through the values parameter. 
        /// </summary>
        /// <param name="key">The key to search for.</param>
        /// <param name="values">Returns all values associated with key, if true was returned.</param>
        /// <returns>True if the dictionary contains key. False if the dictionary does not contain key.</returns>
        protected sealed override bool TryEnumerateValuesForKey(TKey key, out IEnumerator<TValue> values)
        {
            KeyAndValues find = new KeyAndValues(key);
            KeyAndValues item;
            if (hash.Find(find, false, out item)) {
                values = EnumerateValues(item);
                return true;
            }
            else {
                values = null;
                return false;
            }
        }

        /// <summary>
        /// Gets the number of values associated with a given key.
        /// </summary>
        /// <param name="key">The key to count values of.</param>
        /// <returns>The number of values associated with <paramref name="key"/>. If <paramref name="key"/>
        /// is not present in the dictionary, zero is returned.</returns>
        protected sealed override int CountValues(TKey key)
        {
            KeyAndValues find = new KeyAndValues(key);
            KeyAndValues item;
            if (hash.Find(find, false, out item)) {
                return item.Count;
            }
            else {
                return 0;
            }
        }

        #endregion Query items

        #region Cloning

        /// <summary>
        /// Makes a shallow clone of this dictionary; i.e., if keys or values of the
        /// dictionary are reference types, then they are not cloned. If TKey or TValue is a value type,
        /// then each element is copied as if by simple assignment.
        /// </summary>
        /// <remarks>Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary.</remarks>
        /// <returns>The cloned dictionary.</returns>
        public MultiDictionary<TKey, TValue> Clone()
        {
            return new MultiDictionary<TKey, TValue>(allowDuplicateValues, keyEqualityComparer, valueEqualityComparer, equalityComparer, 
                hash.Clone(KeyAndValues.Copy));
        }

        /// <summary>
        /// Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned.
        /// </summary>
        /// <returns>The cloned dictionary.</returns>
        object ICloneable.Clone()
        {
            return Clone();
        }

        /// <summary>
        /// Throw an InvalidOperationException indicating that this type is not cloneable.
        /// </summary>
        /// <param name="t">Type to test.</param>
        private void NonCloneableType(Type t)
        {
            throw new InvalidOperationException(string.Format(Strings.TypeNotCloneable, t.FullName));
        }

        /// <summary>
        /// Makes a deep clone of this dictionary. A new dictionary is created with a clone of
        /// each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is
        /// a value type, then each element is copied as if by simple assignment.
        /// </summary>
        /// <remarks><para>If TKey or TValue is a reference type, it must implement
        /// ICloneable. Otherwise, an InvalidOperationException is thrown.</para>
        /// <para>Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary.</para></remarks>
        /// <returns>The cloned dictionary.</returns>
        /// <exception cref="InvalidOperationException">TKey or TValue is a reference type that does not implement ICloneable.</exception>
        public MultiDictionary<TKey, TValue> CloneContents()
        {
            bool keyIsValueType, valueIsValueType;

            // Make sure that TKey and TValue can be cloned.
            if (!Util.IsCloneableType(typeof(TKey), out keyIsValueType))
                NonCloneableType(typeof(TKey));

            if (!Util.IsCloneableType(typeof(TValue), out valueIsValueType))
                NonCloneableType(typeof(TValue));

            // It's tempting to do a more efficient cloning, utilizing the hash.Clone() method. However, we can't know that
            // the cloned version of the key has the same hash value.

            MultiDictionary<TKey, TValue> newDict = new MultiDictionary<TKey, TValue>(allowDuplicateValues, keyEqualityComparer, valueEqualityComparer);

            foreach (KeyAndValues item in hash) {
                // Clone the key and values parts. Value types can be cloned
                // by just copying them, otherwise, ICloneable is used.
                TKey keyClone;
                TValue[] valuesClone;

                if (keyIsValueType)
                    keyClone = item.Key;
                else {
                    if (item.Key == null)
                        keyClone = default(TKey);  // Really null, because we know TKey isn't a value type.
                    else
                        keyClone = (TKey)(((ICloneable)item.Key).Clone());
                }

                valuesClone = new TValue[item.Count];
                if (valueIsValueType)
                    Array.Copy(item.Values, valuesClone, item.Count);
                else {
                    for (int i = 0; i < item.Count; ++i) {
                        if (item.Values[i] == null)
                            valuesClone[i] = default(TValue);   // Really null, because we know TKey isn't a value type.
                        else
                            valuesClone[i] = (TValue)(((ICloneable)item.Values[i]).Clone());
                    }
                }

                newDict.AddMany(keyClone, valuesClone);
            }

            return newDict;
        }

        #endregion Cloning

    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲综合网| 91精品一区二区三区在线观看| 亚洲国产视频一区二区| 欧美v日韩v国产v| 亚洲成国产人片在线观看| 国产99久久久国产精品潘金| 日本一道高清亚洲日美韩| 亚洲天堂网中文字| 欧美国产欧美综合| 久久久久国产成人精品亚洲午夜| 91 com成人网| 欧美狂野另类xxxxoooo| 91久久国产综合久久| 99久久国产综合精品麻豆| 麻豆专区一区二区三区四区五区| 亚洲三级免费观看| 国产精品传媒视频| 国产精品乱码妇女bbbb| 国产午夜一区二区三区| 精品卡一卡二卡三卡四在线| 91精品国产综合久久久久久漫画| 天天做天天摸天天爽国产一区 | 亚洲天堂免费看| 国产午夜亚洲精品羞羞网站| 精品粉嫩aⅴ一区二区三区四区| 日韩欧美一区二区不卡| 欧美一级国产精品| 日韩一级高清毛片| 欧美亚洲一区二区在线| 欧美日韩色一区| 亚洲欧美偷拍三级| 欧美乱妇一区二区三区不卡视频| 欧美日韩成人综合| 欧美日韩国产一二三| 欧美日韩国产欧美日美国产精品| 欧美久久一二区| 91精品国产综合久久小美女| 精品久久久久久无| 国产日产欧美一区| 亚洲丝袜自拍清纯另类| 国产精品国产三级国产普通话三级| 中文字幕视频一区二区三区久| 亚洲欧美在线另类| 一区二区不卡在线视频 午夜欧美不卡在 | 久久综合久色欧美综合狠狠| 色综合久久久久久久久| 在线亚洲人成电影网站色www| 色婷婷精品大视频在线蜜桃视频| 欧美亚洲综合久久| wwwwxxxxx欧美| 中文字幕一区二区在线播放| 亚洲一区二区在线播放相泽| 日韩av电影一区| 成人三级在线视频| 欧美丝袜丝交足nylons图片| 国产三级一区二区| 99久久综合99久久综合网站| 欧美在线免费视屏| 亚洲v日本v欧美v久久精品| 国产精品丝袜一区| 亚洲综合在线五月| 久久99久久99| 91麻豆免费看片| 91精品一区二区三区在线观看| 91麻豆精品国产自产在线观看一区 | 99在线精品免费| 在线精品亚洲一区二区不卡| 欧美一区二区三区视频在线| 国产欧美日韩中文久久| 亚洲国产aⅴ成人精品无吗| 久久99久久精品欧美| 99精品视频在线观看免费| 制服.丝袜.亚洲.中文.综合| 在线观看国产精品网站| 日韩色在线观看| 国产精品成人免费在线| 免费亚洲电影在线| 91色乱码一区二区三区| 日韩精品在线一区| 亚洲激情六月丁香| 国产精品99久久久久久似苏梦涵| 欧美色倩网站大全免费| 久久影院午夜论| 亚洲成人一区二区在线观看| 成人性色生活片免费看爆迷你毛片| 欧美无乱码久久久免费午夜一区 | 日韩电影在线免费观看| 国产一区二区三区免费看| 色婷婷综合在线| 久久综合狠狠综合| 一区二区三区四区在线免费观看 | 精品国产乱码久久久久久闺蜜| 亚洲精品中文在线观看| 国产精品伊人色| 91精品国产综合久久久蜜臀图片| 亚洲日韩欧美一区二区在线| 精品中文字幕一区二区小辣椒 | 激情成人午夜视频| 欧美精品日韩一区| 亚洲欧美日韩人成在线播放| 一区二区三区在线看| 粉嫩av一区二区三区粉嫩| 日韩视频一区二区在线观看| 三级影片在线观看欧美日韩一区二区 | www.日韩av| 国产欧美日韩亚州综合 | 国产欧美中文在线| 精品一区二区成人精品| 亚洲综合图片区| 日韩精品久久理论片| 欧美这里有精品| 一区二区三区自拍| 成人app网站| 国产女人18水真多18精品一级做| 激情欧美日韩一区二区| 日韩女优电影在线观看| 亚洲一区欧美一区| 色婷婷综合久久久中文一区二区| 中文无字幕一区二区三区| 国产精品综合一区二区| 精品sm在线观看| 欧洲av在线精品| 欧美日免费三级在线| 一区二区三区四区激情| 99久久99久久免费精品蜜臀| 中文字幕亚洲视频| 色综合久久中文字幕| 亚洲另类春色校园小说| 亚洲一区二区三区四区五区黄 | 国产真实乱对白精彩久久| 日韩精品一区二区三区四区视频| 久久爱www久久做| 日本一区二区动态图| 99精品欧美一区| 亚洲国产另类av| 精品国产亚洲在线| zzijzzij亚洲日本少妇熟睡| 亚洲自拍偷拍网站| 日韩一级黄色大片| jlzzjlzz亚洲女人18| 麻豆成人免费电影| 国产欧美视频一区二区三区| 91成人在线精品| 久久se精品一区二区| 国产日韩av一区| 91国产丝袜在线播放| 久久99精品久久久久婷婷| 国产精品嫩草影院com| 欧美日韩精品一区二区三区| 国模娜娜一区二区三区| 亚洲人成网站在线| 日韩精品影音先锋| 色国产综合视频| 久久成人av少妇免费| 亚洲欧美另类小说视频| 日韩精品一区国产麻豆| 色综合久久天天综合网| 国内精品伊人久久久久av影院| 亚洲免费在线视频| 精品久久久久久久久久久久包黑料| 色综合视频在线观看| 九九**精品视频免费播放| 欧美日韩aaaaa| 91精品欧美一区二区三区综合在 | 欧美精品一区二区久久久| 一本大道久久a久久精品综合| 精品入口麻豆88视频| 欧美三级韩国三级日本三斤| 日韩精品一区二区在线观看| 国产成人在线影院| 国产精品久久久久久久久快鸭| 无吗不卡中文字幕| 亚洲一区二区三区激情| 精品在线你懂的| 9191国产精品| 亚洲欧美国产77777| 久久超碰97中文字幕| 91麻豆国产香蕉久久精品| 91精品国产色综合久久ai换脸 | 樱花影视一区二区| 成人sese在线| 777xxx欧美| 色噜噜夜夜夜综合网| 国产在线视频一区二区三区| 日韩激情在线观看| 亚洲情趣在线观看| 国产精品久久久久久一区二区三区 | 欧美精品1区2区3区| 91啪亚洲精品| 国产成人av网站| 国产在线精品一区二区三区不卡 | 欧美乱妇15p| 色综合久久六月婷婷中文字幕| 国产成人亚洲综合a∨猫咪| 免费成人小视频| 丝袜亚洲精品中文字幕一区| 亚洲六月丁香色婷婷综合久久| 亚洲成人av在线电影| 亚洲婷婷在线视频| 成人欧美一区二区三区在线播放|