/** * Perform an inplace NOT with the doc ids from a given DocIdSetIterator, * clearing all the bits for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void InPlaceNot(DocIdSetIterator disi) { while (disi.Next() && (disi.Doc() < Size())) { FastClear(disi.Doc()); } }
/** * Perform an inplace OR with the doc ids from a given DocIdSetIterator, * setting the bit for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void InPlaceOr(DocIdSetIterator disi) { while (disi.Next() && (disi.Doc() < Size())) { FastSet(disi.Doc()); } }
/** * Create a SortedVIntList. * @param docIdSetIterator An iterator providing document numbers as a set of integers. * This DocIdSetIterator is iterated completely when this constructor * is called and it must provide the integers in non * decreasing order. */ public SortedVIntList(DocIdSetIterator docIdSetIterator) { SortedVIntListBuilder builder = new SortedVIntListBuilder(this); while (docIdSetIterator.Next()) { builder.AddInt(docIdSetIterator.Doc()); } builder.Done(); }
/** * Perform an inplace AND with the doc ids from a given DocIdSetIterator, * leaving only the bits set for which the doc ids are in common. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void InPlaceAnd(DocIdSetIterator disi) { int index = NextSetBit(0); int lastNotCleared = -1; while ((index != -1) && disi.SkipTo(index)) { while ((index != -1) && (index < disi.Doc())) { FastClear(index); index = NextSetBit(index + 1); } if (index == disi.Doc()) { lastNotCleared = index; index++; } System.Diagnostics.Debug.Assert((index == -1) || (index > disi.Doc())); } Clear(lastNotCleared + 1, Size()); }
/** * Perform an inplace XOR with the doc ids from a given DocIdSetIterator, * flipping all the bits for each such doc id. * These doc ids should be smaller than the maximum size passed to the * constructor. */ public void InPlaceXor(DocIdSetIterator disi) { while (disi.Next() && (disi.Doc() < Size())) { FastFlip(disi.Doc()); } }