public BitSet
long capacity()
Returns capacity.
long size()
Returns the current capacity of this set. Included for compatibility. This is *not* equal to net.maizegenetics.util.BitSet$cardinality()
boolean isEmpty()
Returns true if there are no set bits
kotlin.Array[] getBits()
Expert: returns the long[] storing the bits
kotlin.Array[] getBits(int startWord,
int endWord)
Expert: returns the long[] storing the bits from start to end
long getBits(int index)
Expert: returns 64 bits at index.
void setBits(kotlin.Array[] bits)
Expert: sets a new long[] to use as the bit storage
void setLong(int wordNum,
long bits)
Expert: sets specified word with given bits.
wordNum - word indexbits - bitsint getNumWords()
Expert: gets the number of longs in the array that are in use
void setNumWords(int nWords)
Expert: sets the number of longs in the array that are in use
boolean get(int index)
Returns true or false for the specified bit index.
boolean fastGet(int index)
Returns true or false for the specified bit index. The index should be less than the BitSet size
boolean get(long index)
Returns true or false for the specified bit index
boolean fastGet(long index)
Returns true or false for the specified bit index. The index should be less than the BitSet size.
int getBit(int index)
Returns 1 if the bit is set, 0 if not. The index should be less than the BitSet size
void set(long index)
Sets a bit, expanding the set size if necessary
void fastSet(int index)
Sets the bit at the specified index. The index should be less than the BitSet size.
void fastSet(long index)
Sets the bit at the specified index. The index should be less than the BitSet size.
void set(long startIndex,
long endIndex)
Sets a range of bits, expanding the set size if necessary
startIndex - lower indexendIndex - one-past the last bit to setvoid fastClear(int index)
Clears a bit. The index should be less than the BitSet size.
void fastClear(long index)
Clears a bit. The index should be less than the BitSet size.
void clear(long index)
Clears a bit, allowing access beyond the current set size without changing the size.
void clear(int startIndex,
int endIndex)
Clears a range of bits. Clearing past the end does not change the size of the set.
startIndex - lower indexendIndex - one-past the last bit to clearvoid clear(long startIndex,
long endIndex)
Clears a range of bits. Clearing past the end does not change the size of the set.
startIndex - lower indexendIndex - one-past the last bit to clearboolean getAndSet(int index)
Sets a bit and returns the previous value. The index should be less than the BitSet size.
boolean getAndClear(int index)
Clears a bit and returns the previous value. The index should be less than the BitSet size.
boolean getAndSet(long index)
Sets a bit and returns the previous value. The index should be less than the BitSet size.
void fastFlip(int index)
Flips a bit. The index should be less than the BitSet size.
void fastFlip(long index)
Flips a bit. The index should be less than the BitSet size.
void flip(long index)
Flips a bit, expanding the set size if necessary
boolean flipAndGet(int index)
Flips a bit and returns the resulting bit value. The index should be less than the BitSet size.
boolean flipAndGet(long index)
Flips a bit and returns the resulting bit value. The index should be less than the BitSet size.
void flip(long startIndex,
long endIndex)
Flips a range of bits, expanding the set size if necessary
startIndex - lower indexendIndex - one-past the last bit to fliplong cardinality()
long cardinality(int index)
Return number of set bits up to and including bit at given index.
index - indexint nextSetBit(int index)
Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.
long nextSetBit(long index)
Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.
int previousSetBit(int index)
Returns the index of the previous set bit starting at the index specified. If the bit at index is set, index is returned, otherwise the next lower numbered set bit is returned. -1 is returned if there are no more set bits.
long previousSetBit(long index)
Returns the index of the previous set bit starting at the index specified. If the bit at index is set, index is returned, otherwise the next lower numbered set bit is returned. -1 is returned if there are no more set bits.
void intersect(BitSet other)
this = this AND other
void union(BitSet other)
this = this OR other
void remove(BitSet other)
Remove all elements set in other. this = this AND_NOT other
void xor(BitSet other)
XOR
void and(BitSet other)
AND
other - void or(BitSet other)
OR
void andNot(BitSet other)
see andNot
boolean intersects(BitSet other)
Returns true if the sets have any elements in common
void ensureCapacityWords(int numWords)
Expand the long[] with the size given as a number of words (64 bit longs). getNumWords() is unchanged by this call.
void ensureCapacity(long numBits)
Ensure that the long[] is big enough to hold numBits, expanding it if necessary. getNumWords() is unchanged by this call.
void trimTrailingZeros()
Lowers numWords, the number of words in use, by checking for trailing zero words.
int indexOfNthSetBit(int n)
Returns index of the nth set bit.
n - nth set bitkotlin.Array[] getIndicesOfSetBits()
Return indices of set bits.
static java.util.stream.Collector<java.lang.Long,?,net.maizegenetics.util.BitSet> collect(long numBits)
Returns BitSet Collector.
numBits - number of bits