Example #1
0
 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);
   }
 }
Example #2
0
 public int getElementType() {
   return Bits.maskBits(getLayoutHelper() >> LH_ELEMENT_TYPE_SHIFT, 0xFF);
 }
Example #3
0
 public int getLog2ElementSize() {
   return Bits.maskBits(getLayoutHelper() >> LH_LOG2_ELEMENT_SIZE_SHIFT, 0xFF);
 }
Example #4
0
 public long getArrayHeaderInBytes() {
   return Bits.maskBits(getLayoutHelper() >> LH_HEADER_SIZE_SHIFT, 0xFF);
 }
Example #5
0
 // 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);
 }