/// <summary/> public TimedValue <TTime, TValue> TryGet(TTime key) { TimedValue <TTime, TValue> value = null; myTimeIndex.TryGetValue(key, out value); return(value); }
public bool Equals(TimedValue <TTime, TValue> other) { if (other == null) { return(false); } return(Time.Equals(other.Time) && Value.Equals(other.Value)); }
protected virtual int CompareValue(TimedValue <TTime, TValue> lhs, TimedValue <TTime, TValue> rhs) { var comparable = lhs.Value as IComparable <TValue>; if (comparable == null) { throw new NotSupportedException("TValue is not comparable. Override CompareValue() in derived class"); } return(comparable.CompareTo(rhs.Value)); }
public static TimedValue <DateTime, Signal> Weight(this TimedValue <DateTime, Signal> self, double factor) { return(new TimedSignal(self.Time, self.Value.Weight(factor))); }
protected override int CompareValue(TimedValue <DateTime, Signal> lhs, TimedValue <DateTime, Signal> rhs) { return(Series.Reference[lhs.Time].Value.CompareTo(Series.Reference[rhs.Time].Value)); }