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