public void atPut(int offset, boolean value) { int index = indexFor(offset); int pos = offset % bitsPerWord; if (value) { data[index] = Bits.setNthBit(data[index], pos); } else { data[index] = Bits.clearNthBit(data[index], pos); } }
public int getElementType() { return Bits.maskBits(getLayoutHelper() >> LH_ELEMENT_TYPE_SHIFT, 0xFF); }
public int getLog2ElementSize() { return Bits.maskBits(getLayoutHelper() >> LH_LOG2_ELEMENT_SIZE_SHIFT, 0xFF); }
public long getArrayHeaderInBytes() { return Bits.maskBits(getLayoutHelper() >> LH_HEADER_SIZE_SHIFT, 0xFF); }
// Accessors public boolean at(int offset) { if (Assert.ASSERTS_ENABLED) { Assert.that(offset >= 0 && offset < size(), "BitMap index out of bounds"); } return Bits.isSetNthBit(wordFor(offset), offset % bitsPerWord); }