org.elasticsearch.common.lucene.docset
Class SlicedOpenBitSet

java.lang.Object
  extended by org.apache.lucene.search.DocIdSet
      extended by org.elasticsearch.common.lucene.docset.DocSet
          extended by org.elasticsearch.common.lucene.docset.SlicedOpenBitSet

public class SlicedOpenBitSet
extends DocSet

Derived from OpenBitSet but works from a slice out of a provided long[] array. It does not expand, as it assumes that the slice is from a cached long[] array, so we can't really expand...


Nested Class Summary
static class SlicedOpenBitSet.SlicedIterator
          An iterator to iterate over set bits in an OpenBitSet.
 
Field Summary
 
Fields inherited from class org.elasticsearch.common.lucene.docset.DocSet
EMPTY_DOC_SET
 
Fields inherited from class org.apache.lucene.search.DocIdSet
EMPTY_DOCIDSET
 
Constructor Summary
SlicedOpenBitSet(long[] bits, int wlen, int from)
           
SlicedOpenBitSet(long[] bits, int from, org.apache.lucene.util.OpenBitSet setToCopy)
           
 
Method Summary
 long capacity()
          Returns the current capacity in bits (1 greater than the index of the last bit)
 long cardinality()
           
 boolean fastGet(int index)
          Returns true or false for the specified bit index.
 boolean fastGet(long index)
          Returns true or false for the specified bit index.
 void fastSet(int index)
          Sets the bit at the specified index.
 void fastSet(long index)
          Sets the bit at the specified index.
 boolean get(int index)
          Returns true or false for the specified bit index.
 boolean get(long index)
          Returns true or false for the specified bit index
 boolean isCacheable()
           
 org.apache.lucene.search.DocIdSetIterator iterator()
           
 long size()
          Returns the current capacity of this set.
 long sizeInBytes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlicedOpenBitSet

public SlicedOpenBitSet(long[] bits,
                        int from,
                        org.apache.lucene.util.OpenBitSet setToCopy)

SlicedOpenBitSet

public SlicedOpenBitSet(long[] bits,
                        int wlen,
                        int from)
Method Detail

isCacheable

public boolean isCacheable()
Overrides:
isCacheable in class org.apache.lucene.search.DocIdSet

sizeInBytes

public long sizeInBytes()
Specified by:
sizeInBytes in class DocSet

capacity

public long capacity()
Returns the current capacity in bits (1 greater than the index of the last bit)


size

public long size()
Returns the current capacity of this set. Included for compatibility. This is *not* equal to cardinality()


cardinality

public long cardinality()
Returns:
the number of set bits

get

public boolean get(int index)
Returns true or false for the specified bit index.

Specified by:
get in class DocSet

fastGet

public boolean fastGet(int index)
Returns true or false for the specified bit index. The index should be less than the OpenBitSet size


get

public boolean get(long index)
Returns true or false for the specified bit index


fastGet

public boolean fastGet(long index)
Returns true or false for the specified bit index. The index should be less than the OpenBitSet size.


fastSet

public void fastSet(int index)
Sets the bit at the specified index. The index should be less than the OpenBitSet size.


fastSet

public void fastSet(long index)
Sets the bit at the specified index. The index should be less than the OpenBitSet size.


iterator

public org.apache.lucene.search.DocIdSetIterator iterator()
                                                   throws java.io.IOException
Specified by:
iterator in class org.apache.lucene.search.DocIdSet
Throws:
java.io.IOException