using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using MarketData.Utils;
using MarketData.Numerical;
using MarketData.DataAccess;

namespace MarketData.MarketDataModel
{
  public class PricesByDate:Dictionary<DateTime,Price>
  {
    private DateTime maxDate=Utility.Epoch;
    private DateTime minDate=Utility.Epoch;
    public PricesByDate()
    {
    }
    public new void Add(DateTime key,Price price)
    {	
		  if(Utility.IsEpoch(key))return;
      base.Add(key,price);
      if(key>maxDate) maxDate=key;
			if(Utility.IsEpoch(minDate))minDate=key;
			else if(key<minDate)minDate=key;
    }
    public DateTime MaxDate
    {
      get { return maxDate; }
    }
    public DateTime MinDate
    {
      get { return minDate; }
    }
  }
}
