コード例 #1
0
 public Triplet(T first, T second, T third)
 {
     this = new Triplet <T>()
     {
         First  = first,
         Second = second,
         Third  = third
     };
 }
コード例 #2
0
        public bool Equals(Triplet <T> other)
        {
            EqualityComparer <T> @default = EqualityComparer <T> .Default;

            if ([email protected](this.First, other.First) || [email protected](this.Second, other.Second))
            {
                return(false);
            }
            return(@default.Equals(this.Third, other.Third));
        }
コード例 #3
0
        public static Triplet <T> Parse(string triplet, char tokenizer)
        {
            Triplet <T> ts = new Triplet <T>();

            if (triplet.IsNotEmpty())
            {
                string[] strArrays             = triplet.Split(new char[] { tokenizer });
                string   tuploidsParseTemplate = Exceptions.Tuploids_ParseTemplate;
                string[] str = new string[] { "3", tokenizer.ToString(CultureInfo.InvariantCulture) };
                Guard.AgainstArgument("pair", (int)strArrays.Length != 2, tuploidsParseTemplate, str);
                ts = new Triplet <T>(strArrays[0].Parse <T>(), strArrays[1].Parse <T>(), strArrays[2].Parse <T>());
            }
            return(ts);
        }