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