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); }
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); }
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; } }
public RowEnumerator(TransactionTable table, IIndexEnumerator <int> enumerator) { this.table = table; this.enumerator = enumerator; }