예제 #1
0
        protected override IList <long> AddRangeToSet(long start, long end, IList <long> list)
        {
            if (list == null)
            {
                list = new List <long>((int)(end - start) + 2);
            }
            IIndexEnumerator <long> i = this.list.GetEnumerator((int)start, (int)end);

            while (i.MoveNext())
            {
                list.Add(i.Current);
            }
            return(list);
        }
예제 #2
0
        public static IEnumerable <T> AsEnumerable <T>(this IIndex <T> index)
        {
            List <T>             list = new List <T>(index.Count);
            IIndexEnumerator <T> i    = index.GetEnumerator();

            // NOTE: We are guarenteed the size of the 'list' array matches the size
            //   of input list.
            while (i.MoveNext())
            {
                list.Add(i.Current);
            }

            return(list);
        }
예제 #3
0
        protected BlockIndexBase(IIndex <T> index)
            : this()
        {
            if (index is BlockIndexBase <T> )
            {
                // Optimization for when the input list is a BlockIntegerList
                BlockIndexBase <T> blockIndex = (BlockIndexBase <T>)index;

                List <IIndexBlock <T> > inBlocks = blockIndex.Blocks;
                int inBlocksCount = inBlocks.Count;
                // For each block in 'blockIndex'
                for (int i = 0; i < inBlocksCount; ++i)
                {
                    // get the block.
                    IIndexBlock <T> block = inBlocks[i];
                    // Insert a new block in this object.
                    IIndexBlock <T> destBlock = InsertBlock(i, NewBlock());
                    // Copy the contents of the source block to the new destination block.
                    block.CopyTo(destBlock);
                }

                // Set the size of the list
                Count = blockIndex.Count;                 //count;
            }
            else
            {
                // The case when IIntegerList type is not known
                IIndexEnumerator <T> i = index.GetEnumerator();
                while (i.MoveNext())
                {
                    Add(i.Current);
                }
            }

            // If the given list is immutable then set this list to immutable
            if (index.IsReadOnly)
            {
                IsReadOnly = true;
            }
        }
예제 #4
0
 public RowEnumerator(TransactionTable table, IIndexEnumerator <int> enumerator)
 {
     this.table      = table;
     this.enumerator = enumerator;
 }