示例#1
0
 public int GetHashCode(StatisticInfo <T> obj)
 {
     unchecked
     {
         var hashCode = obj.Sum.GetHashCode();
         hashCode = (hashCode * 397) ^ obj.Minus.GetHashCode();
         hashCode = (hashCode * 397) ^ obj.Product.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)obj.Count;
         return(hashCode);
     }
 }
示例#2
0
        public int CompareTo(StatisticInfo <T> other)
        {
            var sumComparison = Sum.CompareTo(other.Sum);

            if (sumComparison != 0)
            {
                return(sumComparison);
            }
            var minusComparison = Minus.CompareTo(other.Minus);

            if (minusComparison != 0)
            {
                return(minusComparison);
            }
            var productComparison = Product.CompareTo(other.Product);

            if (productComparison != 0)
            {
                return(productComparison);
            }
            return(Count.CompareTo(other.Count));
        }
示例#3
0
 public bool Equals(StatisticInfo <T> x, StatisticInfo <T> y)
 {
     return(x.Sum.Equals(y.Sum) && x.Minus.Equals(y.Minus) && x.Product.Equals(y.Product) && x.Count == y.Count);
 }
示例#4
0
 public bool Equals(StatisticInfo <T> other)
 {
     return(Sum.Equals(other.Sum) && Minus.Equals(other.Minus) && Product.Equals(other.Product) && Count == other.Count);
 }