org.apache.solr.util
Class BitSetIterator

java.lang.Object
  extended by org.apache.solr.util.BitSetIterator

Deprecated. Use OpenBitSetIterator instead.

public class BitSetIterator
extends Object

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.

Version:
$Id$

Field Summary
protected static int[] bitlist
          Deprecated.  
 
Constructor Summary
BitSetIterator(long[] bits, int numWords)
          Deprecated.  
BitSetIterator(OpenBitSet obs)
          Deprecated.  
 
Method Summary
 int next()
          Deprecated. 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(); }
 int next(int fromIndex)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bitlist

protected static final int[] bitlist
Deprecated. 
Constructor Detail

BitSetIterator

public BitSetIterator(OpenBitSet obs)
Deprecated. 

BitSetIterator

public BitSetIterator(long[] bits,
                      int numWords)
Deprecated. 
Method Detail

next

public int next()
Deprecated. 
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(); }


next

public int next(int fromIndex)
Deprecated. 


Copyright © 2011 Apache Software Foundation. All Rights Reserved.