MCPcopy Create free account
hub / github.com/LFYSec/MScan / flip

Method flip

src/main/java/pascal/taie/util/collection/SparseBitSet.java:246–260  ·  view source on GitHub ↗
(int bitIndex)

Source from the content-addressed store, hash-verified

244 }
245
246 @Override
247 public void flip(int bitIndex) {
248 if ((bitIndex + 1) < 1) {
249 throw new IndexOutOfBoundsException("bitIndex=" + bitIndex);
250 }
251 if (bitIndex >= bitsLength) {
252 resize(bitIndex);
253 }
254 final int w = wordIndex(bitIndex);
255 final int w1 = level1Index(w);
256 final int w2 = level2Index(w);
257 long[] a3 = getOrCreateBlock(w1, w2);
258 a3[level3Index(w)] ^= (1L << bitIndex); // Flip the designated bit
259 invalidateState();
260 }
261
262 @Override
263 public int nextSetBit(int fromIndex) {

Callers

nothing calls this directly

Calls 7

resizeMethod · 0.95
wordIndexMethod · 0.95
level1IndexMethod · 0.95
level2IndexMethod · 0.95
getOrCreateBlockMethod · 0.95
level3IndexMethod · 0.95
invalidateStateMethod · 0.95

Tested by

no test coverage detected