C# Class Lucene.Net.Util.OpenBitSetIterator

An iterator to iterate over set bits in an OpenBitSet. this is faster than nextSetBit() for iterating over the complete set of bits, especially when the density of the bits set is high.
Inheritance: Lucene.Net.Search.DocIdSetIterator
Datei anzeigen Open project: synhershko/lucene.net Class Usage Examples

Public Methods

Method Description
Advance ( int target ) : int
DocID ( ) : int
NextDoc ( ) : int

** alternate shift implementations // 32 bit shifts, but a long shift needed at the end private void shift2() { int y = (int)word; if (y==0) {wordShift +=32; y = (int)(word >>>32); } if ((y & 0x0000FFFF) == 0) { wordShift +=16; y>>>=16; } if ((y & 0x000000FF) == 0) { wordShift +=8; y>>>=8; } indexArray = bitlist[y & 0xff]; word >>>= (wordShift +1); } private void shift3() { int lower = (int)word; int lowByte = lower & 0xff; if (lowByte != 0) { indexArray=bitlist[lowByte]; return; } shift(); } ****

OpenBitSetIterator ( OpenBitSet obs ) : System
OpenBitSetIterator ( long bits, int numWords ) : System

Private Methods

Method Description
Shift ( ) : void

Method Details

Advance() public method

public Advance ( int target ) : int
target int
return int

DocID() public method

public DocID ( ) : int
return int

NextDoc() public method

** alternate shift implementations // 32 bit shifts, but a long shift needed at the end private void shift2() { int y = (int)word; if (y==0) {wordShift +=32; y = (int)(word >>>32); } if ((y & 0x0000FFFF) == 0) { wordShift +=16; y>>>=16; } if ((y & 0x000000FF) == 0) { wordShift +=8; y>>>=8; } indexArray = bitlist[y & 0xff]; word >>>= (wordShift +1); } private void shift3() { int lower = (int)word; int lowByte = lower & 0xff; if (lowByte != 0) { indexArray=bitlist[lowByte]; return; } shift(); } ****
public NextDoc ( ) : int
return int

OpenBitSetIterator() public method

public OpenBitSetIterator ( OpenBitSet obs ) : System
obs OpenBitSet
return System

OpenBitSetIterator() public method

public OpenBitSetIterator ( long bits, int numWords ) : System
bits long
numWords int
return System