public virtual DataBlocks Sort(DataBlock block)
        {
            DataBlocks result = new DataBlocks();

            foreach (ISelectOrder order in orders)
            {
                DataBlocks dbs = order.Sort(block);
                result = result.AppendMerge(dbs);
            }
            result.RemoveEmptyBlokcs();
            return(result);
        }
Exemple #2
0
        public virtual DataBlocks Sort(DataBlock block)
        {
            DataBlocks         result = new DataBlocks();
            IList <MarkedData> list   = block.GetMarkedDataList();

            int[] index = value.Sort(list, feature);
            for (int i = 0; i < list.Count; i++)
            {
                if (IValueOrder.REMOVE != index[i])
                {
                    result.AddDataAtBlock(list[i], index[i]);
                }
            }
            result.RemoveEmptyBlokcs();
            return(result);
        }
Exemple #3
0
        public virtual DataBlocks Select(DataBlock block)
        {
            DataBlocks result = new DataBlocks();

            if (sequences.Count > 0)
            {
                foreach (OrderSequence sequence in sequences)
                {
                    DataBlocks bd = sequence.Sort(block);
                    result = result.AppendMerge(bd);
                }
            }
            else
            {
                result.AddDataBlock(block);
            }
            result.RemoveEmptyBlokcs();
            return(result);
        }
Exemple #4
0
        public virtual DataBlocks Sort(DataBlock block)
        {
            DataBlocks result = new DataBlocks();

            result.AddDataBlock(block);
            DataBlocks temp = new DataBlocks();

            for (int i = 0; i < orders.Count; i++)
            {
                temp.Clear();
                foreach (DataBlock b in result.GetBlocks())
                {
                    temp.AddDataBlocks(orders[i].Sort(b));
                }
                result.Clear();
                foreach (DataBlock db in temp.GetBlocks())
                {
                    result.AddDataBlock(db);
                }
            }
            return(result);
        }
        public virtual DataBlocks Sort(DataBlock block)
        {
            DataBlocks result = new DataBlocks();

            if ((andList == null || andList.Count == 0) && (orList == null || orList.Count == 0) && (appendList == null || appendList.Count == 0))
            {
                result.AddDataBlock(block);
            }
            if (andList != null && andList.Count > 0)
            {
                IList <DataBlock> blocks = new List <DataBlock>();
                blocks.Add(block);
                IList <DataBlock> temps = new List <DataBlock>();
                foreach (ISelectOrder order in andList)
                {
                    temps.Clear();
                    foreach (DataBlock bl in blocks)
                    {
                        DataBlocks dbs = order.Sort(bl);
                        foreach (DataBlock db in dbs.GetBlocks())
                        {
                            temps.Add(db);
                        }
                    }
                    if (temps.Count == 0)
                    {
                        return(new DataBlocks());
                    }
                    blocks.Clear();
                    Sharpen.Collections.AddAll(blocks, temps);
                }
                foreach (DataBlock bl_1 in blocks)
                {
                    result.AddDataBlock(bl_1);
                }
            }
            if (orList != null && orList.Count > 0)
            {
                DataBlocks orResult = new DataBlocks();
                foreach (ISelectOrder order in orList)
                {
                    orResult = orResult.OrMerge(order.Sort(block));
                }
                if (andList != null && andList.Count > 0)
                {
                    result = result.AndMerge(orResult);
                }
                else
                {
                    result = orResult;
                }
            }
            if (appendList != null && appendList.Count > 0)
            {
                foreach (ISelectOrder order in appendList)
                {
                    result = result.AppendMerge(order.Sort(block));
                }
            }
            result.RemoveEmptyBlokcs();
            return(result);
        }