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