MCPcopy Create free account
hub / github.com/BirolLab/RNA-Bloom / getAndSet

Method getAndSet

src/rnabloom/bloom/buffer/LargeBitBuffer.java:68–81  ·  view source on GitHub ↗
(long index)

Source from the content-addressed store, hash-verified

66 }
67
68 @Override
69 public boolean getAndSet(long index) {
70 long byteIndex = index / Byte.SIZE;
71 byte b = backingByteBuffer.get(byteIndex);
72 byte mask = (byte) (1 << (int) (byteIndex % Byte.SIZE));
73 boolean isSet = (b & mask) != 0;
74
75 if (!isSet) {
76 b |= mask;
77 backingByteBuffer.set(byteIndex, b);
78 }
79
80 return isSet;
81 }
82
83 @Override
84 public long size() {

Callers 3

lookupThenAddMethod · 0.45
lookupAndAddMethod · 0.45
lookupThenAddMethod · 0.45

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected