org.apache.blur.filter
Class IndexFileBitSetIterator

java.lang.Object
  extended by org.apache.lucene.search.DocIdSetIterator
      extended by org.apache.blur.filter.IndexFileBitSetIterator

public class IndexFileBitSetIterator
extends org.apache.lucene.search.DocIdSetIterator

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.


Field Summary
 
Fields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS
 
Constructor Summary
IndexFileBitSetIterator(org.apache.lucene.store.IndexInput indexInput)
           
 
Method Summary
 int advance(int target)
           
 long cost()
           
 int docID()
           
 int nextDoc()
          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(); }
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexFileBitSetIterator

public IndexFileBitSetIterator(org.apache.lucene.store.IndexInput indexInput)
Method Detail

nextDoc

public int nextDoc()
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(); }

Specified by:
nextDoc in class org.apache.lucene.search.DocIdSetIterator

advance

public int advance(int target)
Specified by:
advance in class org.apache.lucene.search.DocIdSetIterator

docID

public int docID()
Specified by:
docID in class org.apache.lucene.search.DocIdSetIterator

cost

public long cost()
Specified by:
cost in class org.apache.lucene.search.DocIdSetIterator


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.