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

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

?? triple.cs

?? C#寫的類似于STL的集合類,首先是C#編寫,可以用于.net變程.
?? CS
字號:
?//******************************
// Written by Peter Golde
// Copyright (c) 2004-2005, Wintellect
//
// Use and restribution of this code is subject to the license agreement 
// contained in the file "License.txt" accompanying this file.
//******************************

using System;
using System.Collections.Generic;

namespace Wintellect.PowerCollections
{
    /// <summary>
    /// Stores a triple of objects within a single struct. This struct is useful to use as the
    /// T of a collection, or as the TKey or TValue of a dictionary.
    /// </summary>
    [Serializable]
    public struct Triple<TFirst, TSecond, TThird> : IComparable, IComparable<Triple<TFirst, TSecond, TThird>>
    {
        /// <summary>
        /// Comparers for the first and second type that are used to compare
        /// values.
        /// </summary>
        private static IComparer<TFirst> firstComparer = Comparer<TFirst>.Default;
        private static IComparer<TSecond> secondComparer = Comparer<TSecond>.Default;
        private static IComparer<TThird> thirdComparer = Comparer<TThird>.Default;

        private static IEqualityComparer<TFirst> firstEqualityComparer = EqualityComparer<TFirst>.Default;
        private static IEqualityComparer<TSecond> secondEqualityComparer = EqualityComparer<TSecond>.Default;
        private static IEqualityComparer<TThird> thirdEqualityComparer = EqualityComparer<TThird>.Default;

        /// <summary>
        /// The first element of the triple.
        /// </summary>
        public TFirst First;

        /// <summary>
        /// The second element of the triple.
        /// </summary>
        public TSecond Second;

        /// <summary>
        /// The thrid element of the triple.
        /// </summary>
        public TThird Third;

        /// <summary>
        /// Creates a new triple with given elements.
        /// </summary>
        /// <param name="first">The first element of the triple.</param>
        /// <param name="second">The second element of the triple.</param>
        /// <param name="third">The third element of the triple.</param>
        public Triple(TFirst first, TSecond second, TThird third)
        {
            this.First = first;
            this.Second = second;
            this.Third = third;
        }

        /// <summary>
        /// Determines if this triple is equal to another object. The triple is equal to another object 
        /// if that object is a Triple, all element types are the same, and the all three elements
        /// compare equal using object.Equals.
        /// </summary>
        /// <param name="obj">Object to compare for equality.</param>
        /// <returns>True if the objects are equal. False if the objects are not equal.</returns>
        public override bool Equals(object obj)
        {
            if (obj != null && obj is Triple<TFirst, TSecond, TThird>) {
                Triple<TFirst, TSecond, TThird> other = (Triple<TFirst, TSecond, TThird>)obj;

                return Equals(other);
            }
            else {
                return false;
            }
        }

        /// <summary>
        /// Determines if this triple is equal to another triple. Two triples are equal if the all three elements
        /// compare equal using IComparable&lt;T&gt;.Equals or object.Equals.
        /// </summary>
        /// <param name="other">Triple to compare with for equality.</param>
        /// <returns>True if the triples are equal. False if the triples are not equal.</returns>
        public bool Equals(Triple<TFirst, TSecond, TThird> other)
        {
            return firstEqualityComparer.Equals(First, other.First) &&
                secondEqualityComparer.Equals(Second, other.Second) &&
                thirdEqualityComparer.Equals(Third, other.Third);
        }

        /// <summary>
        /// Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection.
        /// Two triples that compare equal (using Equals) will have the same hash code. The hash code for
        /// the triple is derived by combining the hash codes for each of the two elements of the triple.
        /// </summary>
        /// <returns>The hash code.</returns>
        public override int GetHashCode()
        {
            // Build the hash code from the hash codes of First and Second. 
            int hashFirst = (First == null) ? 0x61E04917 : First.GetHashCode();
            int hashSecond = (Second == null) ? 0x198ED6A3 : Second.GetHashCode();
            int hashThird = (Third == null) ? 0x40FC1877 : Third.GetHashCode();
            return hashFirst ^ hashSecond ^ hashThird;
        }

        /// <summary>
        /// <para> Compares this triple to another triple of the some type. The triples are compared by using
        /// the IComparable&lt;T&gt; or IComparable interface on TFirst, TSecond, and TThird. The triples
        /// are compared by their first elements first, if their first elements are equal, then they
        /// are compared by their second elements. If their second elements are also equal, then they
        /// are compared by their third elements.</para>
        /// <para>If TFirst, TSecond, or TThird does not implement IComparable&lt;T&gt; or IComparable, then
        /// an NotSupportedException is thrown, because the triples cannot be compared.</para>
        /// </summary>
        /// <param name="other">The triple to compare to.</param>
        /// <returns>An integer indicating how this triple compares to <paramref name="other"/>. Less
        /// than zero indicates this triple is less than <paramref name="other"/>. Zero indicate this triple is
        /// equals to <paramref name="other"/>. Greater than zero indicates this triple is greater than
        /// <paramref name="other"/>.</returns>
        /// <exception cref="NotSupportedException">Either FirstSecond, TSecond, or TThird is not comparable
        /// via the IComparable&lt;T&gt; or IComparable interfaces.</exception>
        public int CompareTo(Triple<TFirst, TSecond, TThird> other)
        {
            try {
                int firstCompare = firstComparer.Compare(First, other.First);
                if (firstCompare != 0)
                    return firstCompare;
                int secondCompare = secondComparer.Compare(Second, other.Second);
                if (secondCompare != 0)
                    return secondCompare;
                else
                    return thirdComparer.Compare(Third, other.Third);
            }
            catch (ArgumentException) {
                // Determine which type caused the problem for a better error message.
                if (!typeof(IComparable<TFirst>).IsAssignableFrom(typeof(TFirst)) &&
                    !typeof(System.IComparable).IsAssignableFrom(typeof(TFirst))) {
                    throw new NotSupportedException(string.Format(Strings.UncomparableType, typeof(TFirst).FullName));
                }
                else if (!typeof(IComparable<TSecond>).IsAssignableFrom(typeof(TSecond)) &&
                    !typeof(System.IComparable).IsAssignableFrom(typeof(TSecond))) {
                    throw new NotSupportedException(string.Format(Strings.UncomparableType, typeof(TSecond).FullName));
                }
                else if (!typeof(IComparable<TThird>).IsAssignableFrom(typeof(TThird)) &&
                    !typeof(System.IComparable).IsAssignableFrom(typeof(TThird))) {
                    throw new NotSupportedException(string.Format(Strings.UncomparableType, typeof(TThird).FullName));
                }
                else
                    throw;              // Hmmm. Unclear why we got the ArgumentException. 
            }
        }

        /// <summary>
        /// <para> Compares this triple to another triple of the some type. The triples are compared by using
        /// the IComparable&lt;T&gt; or IComparable interface on TFirst, TSecond, and TThird. The triples
        /// are compared by their first elements first, if their first elements are equal, then they
        /// are compared by their second elements. If their second elements are also equal, then they
        /// are compared by their third elements.</para>
        /// <para>If TFirst, TSecond, or TThird does not implement IComparable&lt;T&gt; or IComparable, then
        /// an NotSupportedException is thrown, because the triples cannot be compared.</para>
        /// </summary>
        /// <param name="obj">The triple to compare to.</param>
        /// <returns>An integer indicating how this triple compares to <paramref name="obj"/>. Less
        /// than zero indicates this triple is less than <paramref name="obj"/>. Zero indicate this triple is
        /// equals to <paramref name="obj"/>. Greater than zero indicates this triple is greater than
        /// <paramref name="obj"/>.</returns>
        /// <exception cref="ArgumentException"><paramref name="obj"/> is not of the correct type.</exception>
        /// <exception cref="NotSupportedException">Either FirstSecond, TSecond, or TThird is not comparable
        /// via the IComparable&lt;T&gt; or IComparable interfaces.</exception>
        int IComparable.CompareTo(object obj)
        {
            if (obj is Triple<TFirst, TSecond, TThird>)
                return CompareTo((Triple<TFirst, TSecond,TThird>)obj);
            else
                throw new ArgumentException(Strings.BadComparandType, "obj");
        }

        /// <summary>
        /// Returns a string representation of the triple. The string representation of the triple is
        /// of the form:
        /// <c>First: {0}, Second: {1}, Third: {2}</c>
        /// where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and
        /// {2} is the result of Third.ToString() (or "null" if they are null.)
        /// </summary>
        /// <returns> The string representation of the triple.</returns>
        public override string ToString()
        {
            return string.Format("First: {0}, Second: {1}, Third: {2}", 
                (First == null) ? "null" : First.ToString(), 
                (Second == null) ? "null" : Second.ToString(),
                (Third == null) ? "null" : Third.ToString());
        }

        /// <summary>
        /// Determines if two triples are equal. Two triples are equal if the all three elements
        /// compare equal using IComparable&lt;T&gt;.Equals or object.Equals.
        /// </summary>
        /// <param name="pair1">First triple to compare.</param>
        /// <param name="pair2">Second triple to compare.</param>
        /// <returns>True if the triples are equal. False if the triples are not equal.</returns>
        public static bool operator ==(Triple<TFirst, TSecond, TThird> pair1, Triple<TFirst, TSecond, TThird> pair2)
        {
            return pair1.Equals(pair2); 
        }

        /// <summary>
        /// Determines if two triples are not equal. Two triples are equal if the all three elements
        /// compare equal using IComparable&lt;T&gt;.Equals or object.Equals.
        /// </summary>
        /// <param name="pair1">First triple to compare.</param>
        /// <param name="pair2">Second triple to compare.</param>
        /// <returns>True if the triples are not equal. False if the triples are equal.</returns>
        public static bool operator !=(Triple<TFirst, TSecond, TThird> pair1, Triple<TFirst, TSecond, TThird> pair2)
        {
            return ! pair1.Equals(pair2);
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区视频| 日韩黄色免费电影| 一区二区高清在线| 日本不卡一区二区| 国产.欧美.日韩| 欧美精品久久99久久在免费线| 久久综合久久久久88| 亚洲视频1区2区| 免费在线视频一区| 在线免费观看日本欧美| 精品久久久久久久久久久久久久久久久 | 精品久久久久久亚洲综合网| 日韩一区日韩二区| 麻豆久久久久久| 在线国产亚洲欧美| 精品久久久久久久久久久久久久久久久 | 三级久久三级久久| 成人午夜av影视| 777亚洲妇女| 亚洲视频狠狠干| 国产精品 日产精品 欧美精品| aaa国产一区| 日韩一级大片在线观看| 亚洲综合丝袜美腿| 成人影视亚洲图片在线| 日韩一区二区三| 亚洲一区二区欧美日韩| 97久久久精品综合88久久| 欧美本精品男人aⅴ天堂| 亚洲欧美日韩中文字幕一区二区三区| 九九**精品视频免费播放| 欧美精品xxxxbbbb| 亚洲天堂av一区| 国产一区在线不卡| 日韩欧美在线123| 日韩高清一区二区| 91久久精品网| 亚洲一区二区在线播放相泽| 91日韩在线专区| 久久久亚洲精品石原莉奈 | 久久久久久久久蜜桃| 美腿丝袜亚洲色图| 欧美高清一级片在线| 亚洲裸体xxx| 色94色欧美sute亚洲线路二| 国产精品久久久久久久久免费丝袜| 国产精品一线二线三线精华| 久久丝袜美腿综合| 国产一区二区在线看| 久久久91精品国产一区二区三区| 久久疯狂做爰流白浆xx| 日韩欧美成人午夜| 亚洲综合免费观看高清完整版| 在线精品视频免费播放| 亚洲国产精品久久人人爱| 欧美高清你懂得| 亚洲欧美日韩综合aⅴ视频| 91免费在线播放| 亚洲一区二三区| 日韩欧美一级特黄在线播放| 国内欧美视频一区二区| 欧美国产成人在线| 99在线精品免费| 亚洲大片免费看| 777亚洲妇女| 国产精品18久久久久久vr| 国产精品毛片久久久久久久| 韩国欧美国产1区| 国产欧美久久久精品影院| 成人免费va视频| 自拍偷拍欧美精品| 91精品久久久久久蜜臀| 国产永久精品大片wwwapp| 欧美一区二区三区视频免费播放| 久久99精品视频| 国产精品久久久久久久久快鸭| 色国产精品一区在线观看| 日韩影院在线观看| 久久精品欧美一区二区三区不卡 | 国产亚洲成aⅴ人片在线观看| 99免费精品在线| 日韩专区欧美专区| 久久九九99视频| 在线观看成人免费视频| 国产中文一区二区三区| 欧美国产精品一区二区| 欧美区在线观看| 成人午夜在线播放| 午夜a成v人精品| 国产精品久久久久影院老司| 欧美绝品在线观看成人午夜影视| 狠狠色综合日日| 亚洲国产三级在线| 国产欧美一区二区精品性色超碰| 欧美系列亚洲系列| 懂色av一区二区三区免费看| 日韩精品电影在线| 久久久三级国产网站| 欧美自拍丝袜亚洲| 99久久er热在这里只有精品15 | 成人午夜视频在线观看| 香蕉久久一区二区不卡无毒影院 | 91亚洲精品乱码久久久久久蜜桃| 午夜亚洲福利老司机| 日韩美女视频一区二区| 日韩欧美久久久| av激情成人网| 国产中文字幕精品| 日本视频免费一区| 亚洲午夜久久久久久久久久久| 久久久亚洲午夜电影| 日韩免费高清av| 日本福利一区二区| av电影在线不卡| 国产成人激情av| 激情综合色综合久久| 天天综合色天天| 婷婷成人激情在线网| 亚洲一区在线视频| 亚洲老妇xxxxxx| 亚洲精品高清在线| 1区2区3区欧美| 亚洲欧美另类小说视频| 亚洲素人一区二区| 综合自拍亚洲综合图不卡区| 亚洲视频一区二区在线观看| 国产精品国产自产拍在线| 久久久久久久综合日本| 国产亚洲欧洲997久久综合| 亚洲精品一区二区三区影院| 69堂精品视频| 在线欧美日韩精品| 欧美电影在线免费观看| 精品视频免费在线| 久久国产精品免费| 亚洲精品中文字幕乱码三区| 一区二区在线观看免费视频播放| 亚洲一线二线三线久久久| 日韩av一级电影| 国产高清不卡一区二区| 97久久精品人人爽人人爽蜜臀| 欧美性感一类影片在线播放| 日韩女优电影在线观看| 国产精品传媒视频| 性久久久久久久久| 福利电影一区二区| 欧美日韩成人在线| 久久久www成人免费毛片麻豆| 亚洲精品一二三四区| 久久不见久久见中文字幕免费| 成人美女视频在线观看| 欧美一区二区三区在线电影| 国产精品全国免费观看高清| 丝瓜av网站精品一区二区| 国产99一区视频免费| 欧美丰满少妇xxxbbb| 国产精品毛片久久久久久| 日韩专区中文字幕一区二区| www.视频一区| 日韩视频在线一区二区| 亚洲综合在线视频| 国产精品自在欧美一区| 欧美日韩一区二区在线观看 | 国产视频一区不卡| 亚洲自拍与偷拍| 国产盗摄视频一区二区三区| 欧美军同video69gay| 日韩理论在线观看| 国产一区二区主播在线| 欧美老女人第四色| 亚洲免费电影在线| 国产99久久久国产精品潘金网站| 欧美裸体bbwbbwbbw| 亚洲天堂av一区| 成人黄色av网站在线| 久久综合九色欧美综合狠狠| 亚洲二区在线观看| 色婷婷综合在线| 亚洲欧美中日韩| 懂色av中文一区二区三区| 精品成人私密视频| 青青草伊人久久| 欧美人妇做爰xxxⅹ性高电影| 一区二区三区四区不卡视频| 成人aaaa免费全部观看| 国产视频一区在线播放| 国产一区二区三区最好精华液| 欧美一区二区三区精品| 日韩激情av在线| 欧美日韩午夜精品| 亚洲国产精品尤物yw在线观看| 91麻豆成人久久精品二区三区| 日本一区二区成人| 国产成人av资源| 欧美国产综合一区二区| 高清在线成人网| 欧美激情在线一区二区| 国产精品羞羞答答xxdd| 国产午夜久久久久| 丰满少妇久久久久久久|