Package org.elasticsearch.common.util
Class BitArray
java.lang.Object
org.elasticsearch.common.util.BitArray
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Releasable
public final class BitArray extends java.lang.Object implements Releasable
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description longcardinality()voidclear(long index)Clear theindexth bit.voidclose()booleanget(long index)Is theindexth bit set?longnextSetBit(long index)voidor(BitArray other)this = this OR othervoidset(long index)Set theindexth bit.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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 theindexth bit. -
or
this = this OR other -
nextSetBit
public long nextSetBit(long index) -
cardinality
public long cardinality() -
clear
public void clear(long index)Clear theindexth bit. -
get
public boolean get(long index)Is theindexth bit set? -
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceReleasable
-