@Test public void testClear() { BooleanBag bag; bag = new BooleanBag(); bag.set(0, true); bag.set(1, true); bag.set(63, true); bag.clear(); assertEquals((Boolean) false, (Boolean) bag.get(0)); assertEquals((Boolean) false, (Boolean) bag.get(1)); assertEquals((Boolean) false, (Boolean) bag.get(63)); assertEquals(64, bag.buffer.length); Mask mask = new Mask(); bag = new BooleanBag(); bag.set(0, true); bag.set(1, true); bag.set(63, true); mask.set(63); mask.set(0); bag.clear(mask); assertEquals((Boolean) false, (Boolean) bag.get(0)); assertNotEquals((Boolean) false, (Boolean) bag.get(1)); assertEquals((Boolean) false, (Boolean) bag.get(63)); mask.set(1); mask.set(457); bag.clear(mask); assertEquals((Boolean) false, (Boolean) bag.get(0)); assertEquals((Boolean) false, (Boolean) bag.get(1)); assertEquals((Boolean) false, (Boolean) bag.get(63)); assertEquals(64, bag.buffer.length); }
@Override public void clear() { boolean[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = false; }
BooleanBag implements AnyBag<BooleanBag> { @Override public void clear() { boolean[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = false; } }
BooleanBag implements AnyBag<BooleanBag> { @Override public void clear() { boolean[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = false; } BooleanBag(); }
BooleanBag implements AnyBag<BooleanBag> { @Override public void clear() { boolean[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = false; } BooleanBag(); @Override void copyFrom(BooleanBag from); @Override void copyFrom(BooleanBag from, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int length); @Override void copyFrom(BooleanBag from, int length, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int fromOffset, int length); @Override void copyFrom(BooleanBag from, int fromOffset, int length, boolean clearExceeding); @Override void copyPartFrom(BooleanBag from, int fromOffset, int toOffset, int length); @Override void ensureCapacity(int capacity); boolean get(int index); void set(int index, boolean value); @Override void clear(); @Override void clear(Mask mask); }
BooleanBag implements AnyBag<BooleanBag> { @Override public void clear() { boolean[] buffer = this.buffer; for (int i = 0, n = buffer.length; i < n; ++i) buffer[i] = false; } BooleanBag(); @Override void copyFrom(BooleanBag from); @Override void copyFrom(BooleanBag from, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int length); @Override void copyFrom(BooleanBag from, int length, boolean clearExceeding); @Override void copyFrom(BooleanBag from, int fromOffset, int length); @Override void copyFrom(BooleanBag from, int fromOffset, int length, boolean clearExceeding); @Override void copyPartFrom(BooleanBag from, int fromOffset, int toOffset, int length); @Override void ensureCapacity(int capacity); boolean get(int index); void set(int index, boolean value); @Override void clear(); @Override void clear(Mask mask); @Experimental
    public boolean[] buffer; }