Пример #1
0
 public void addFilterCondition(AppFilterItem item)
 {
     if (item != null)
     {
         m_conditionMap.Add(item.m_type, item);
     }
 }
Пример #2
0
        public List <string> doFilter(List <string> stocks)
        {
            List <string> src = new List <string>();

            src.AddRange(stocks);
            List <string> target = new List <string>();

            target.AddRange(stocks);
            for (int i = 0; i < ms_filterSequence.Length; i++)
            {
                AppFilterType type = ms_filterSequence[i];
                if (m_conditionMap.ContainsKey(type))
                {
                    AppFilterItem item = m_conditionMap[type];
                    IStockFilter  flt  = item.generateFilter();
                    if (flt != null)
                    {
                        target = flt.filter(src);
                        outputInfo(item, src.Count, target.Count);
                        src.Clear();
                        src.AddRange(target);
                    }
                }
            }

            return(target);
        }
Пример #3
0
 public void addCondition(AppFilterItem item)
 {
     if (m_condition != null)
     {
         m_condition.addFilterCondition(item);
     }
 }
Пример #4
0
 protected void outputInfo(AppFilterItem item, int srcCount, int targetCount)
 {
     if (item != null)
     {
         string msg = "Filter type: " + item.m_type.ToString() +
                      ", sub type: " + item.m_subType.ToString() +
                      ", before filter: " + srcCount.ToString() +
                      ", after filter: " + targetCount.ToString() + ".";
         Logger.log(msg);
     }
 }