MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / set

Method set

Ports/CLDC11/src/java/util/BitSet.java:364–379  ·  view source on GitHub ↗
(int pos)

Source from the content-addressed store, hash-verified

362 ///
363 /// - #clear(int, int)
364 public void set(int pos) {
365 if (pos < 0) {
366 throw new IndexOutOfBoundsException("" + pos);
367 }
368
369 int len = (pos >> OFFSET) + 1;
370 if (len > bits.length) {
371 growLength(len);
372 }
373 bits[len - 1] |= TWO_N_ARRAY[pos & RIGHT_BITS];
374 if (len > actualArrayLength) {
375 actualArrayLength = len;
376 isLengthActual = true;
377 }
378 needClear();
379 }
380
381 /// Sets the bit at index `pos` to `val`. Grows the
382 /// `BitSet` if `pos > size`.

Callers

nothing calls this directly

Calls 3

growLengthMethod · 0.95
needClearMethod · 0.95
clearMethod · 0.95

Tested by

no test coverage detected