Ejemplo n.º 1
0
        internal float GetStatistic(int indexId, IndexCostSource src, IndexCostType type, IndexCostInformation info,
                                    int?theoreticalIndexSize)
        {
            IndexInfo <T> index;

            var i = _indexes.Where(p => p.IndexID == indexId);

            if (i.Count() != 1)
            {
                throw new WronxIndexIdException(indexId);
            }
            else
            {
                index = i.Single();
            }

            switch (src)
            {
            case IndexCostSource.Statistic:
                return(getStatistics(index, type, info));

            case IndexCostSource.Theoretic:
                return(getTheoretical(GetIndex(indexId), type, info, theoreticalIndexSize));

            default:
                throw new UnexpectedStatisticSourceException(src);
            }
        }
Ejemplo n.º 2
0
 public UnexpectedStatisticSourceException(IndexCostSource src)
     : base(String.Format("Unexpected index statistic source requested: {0}", src.ToString()))
 {
 }
Ejemplo n.º 3
0
 public float GetStatistic(int indexID, IndexCostSource src, IndexCostType type, IndexCostInformation info,
                           int?theoreticalIndexSize)
 {
     return(global::IndexMechanism.IndexManager.IndexManager <T> .GetInstance().GetStatistic(indexID, src, type, info, theoreticalIndexSize));
 }