Пример #1
0
        public bool Equals(Quartet <T> other)
        {
            EqualityComparer <T> comparer = EqualityComparer <T> .Default;

            return(comparer.Equals(First, other.First) &&
                   comparer.Equals(Second, other.Second) &&
                   comparer.Equals(Third, other.Third) &&
                   comparer.Equals(Fourth, other.Fourth));
        }
Пример #2
0
        public static Quartet <T> Parse(string quintet, char tokenizer)
        {
            Quartet <T> result = default(Quartet <T>);

            if (quintet.IsNotEmpty())
            {
                var tokens = quintet.Split(tokenizer);

                Guard.AgainstArgument("pair", tokens.Length != 4,
                                      Resources.Exceptions.Tuploids_ParseTemplate,
                                      "4",
                                      tokenizer.ToString());

                result = new Quartet <T>(
                    tokens[0].Parse <T>(),
                    tokens[1].Parse <T>(),
                    tokens[2].Parse <T>(),
                    tokens[3].Parse <T>());
            }
            return(result);
        }