Пример #1
0
        /// <summary/>
        public TimedValue <TTime, TValue> TryGet(TTime key)
        {
            TimedValue <TTime, TValue> value = null;

            myTimeIndex.TryGetValue(key, out value);
            return(value);
        }
Пример #2
0
        public bool Equals(TimedValue <TTime, TValue> other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Time.Equals(other.Time) && Value.Equals(other.Value));
        }
Пример #3
0
        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));
        }
Пример #4
0
 public static TimedValue <DateTime, Signal> Weight(this TimedValue <DateTime, Signal> self, double factor)
 {
     return(new TimedSignal(self.Time, self.Value.Weight(factor)));
 }
Пример #5
0
 protected override int CompareValue(TimedValue <DateTime, Signal> lhs, TimedValue <DateTime, Signal> rhs)
 {
     return(Series.Reference[lhs.Time].Value.CompareTo(Series.Reference[rhs.Time].Value));
 }