java.lang.Object
org.elasticsearch.common.util.BitArray
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.lucene.util.Accountable
,Releasable
public final class BitArray
extends Object
implements org.apache.lucene.util.Accountable, Releasable
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
void
clear
(long index) Clear theindex
th bit.void
close()
boolean
get
(long index) Is theindex
th bit set?boolean
getAndSet
(long index) Set theindex
th bit and returntrue
if the bit was set already.long
nextSetBit
(long index) void
this = this OR otherlong
void
set
(long index) Set theindex
th bit.long
size()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
BitArray
Create the BitArray.- Parameters:
initialSize
- the initial size of underlying storage expressed in bits.
-
-
Method Details
-
set
public void set(long index) Set theindex
th bit. -
getAndSet
public boolean getAndSet(long index) Set theindex
th bit and returntrue
if the bit was set already. -
or
this = this OR other -
nextSetBit
public long nextSetBit(long index) -
cardinality
public long cardinality() -
clear
public void clear(long index) Clear theindex
th bit. -
get
public boolean get(long index) Is theindex
th bit set? -
size
public long size() -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsed
in interfaceorg.apache.lucene.util.Accountable
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceReleasable
-