public override string ToString() { string ls = LowestValue.Equals(minValue) ? "-Inf" : LowestValue.ToString(); string hs = HighestValue.Equals(maxValue) ? "Inf" : HighestValue.ToString(); return(Value.ToString() + " [" + ls + ", " + hs + "]"); }
public override int GetHashCode() { unchecked { var hashCode = Id.GetHashCode(); hashCode = (hashCode * 397) ^ TimeStamp.GetHashCode(); hashCode = (hashCode * 397) ^ (RealmSlug?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ MeanValue.GetHashCode(); hashCode = (hashCode * 397) ^ AdjustedMeanValue.GetHashCode(); hashCode = (hashCode * 397) ^ LowestValue.GetHashCode(); hashCode = (hashCode * 397) ^ HighestValue.GetHashCode(); hashCode = (hashCode * 397) ^ Quantity; return(hashCode); } }
public override dynamic GetObjectToSerialize(bool is_explicit) { IsExplicit = is_explicit; if (IsExplicit) { Dictionary <string, object> dict = base.GetObjectToSerialize(is_explicit) as Dictionary <string, object>; if (HighestValue.CompareTo(maxValue) < 0) { dict["higher_bound"] = HighestValue; } if (LowestValue.CompareTo(minValue) > 0) { dict["lower_bound"] = LowestValue; } return(dict); } return(Value); }
protected bool Equals(ItemData other) { return(Id == other.Id && TimeStamp.Equals(other.TimeStamp) && string.Equals(RealmSlug, other.RealmSlug) && MeanValue.Equals(other.MeanValue) && AdjustedMeanValue.Equals(other.AdjustedMeanValue) && LowestValue.Equals(other.LowestValue) && HighestValue.Equals(other.HighestValue) && Quantity == other.Quantity); }