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