@Test public void testCopyFrom() { FloatBag bag0, bag1; float e0 = 1f, e1 = 1f, e2 = 1f, e3 = 1f; bag0 = new FloatBag(); bag0.set(0, e0); bag0.set(3, e1); bag0.set(9, e2); bag1 = new FloatBag(); bag1.copyFrom(bag0); assertEquals((Float) e0, (Float) bag1.get(0)); assertEquals((Float) e1, (Float) bag1.get(3)); assertEquals((Float) e2, (Float) bag1.get(9)); bag1 = new FloatBag(); bag1.set(53, e3); bag1.copyFrom(bag0, false); assertEquals((Float) e0, (Float) bag1.get(0)); assertEquals((Float) e1, (Float) bag1.get(3)); assertEquals((Float) e2, (Float) bag1.get(9)); assertEquals((Float) e3, (Float) bag1.get(53)); bag1 = new FloatBag(); bag1.set(53, e3); bag1.copyFrom(bag0, true); assertEquals((Float) e0, (Float) bag1.get(0)); assertEquals((Float) e1, (Float) bag1.get(3)); assertEquals((Float) e2, (Float) bag1.get(9)); assertEquals((Float) 0f, (Float) bag1.get(53)); bag0 = new FloatBag(); bag0.set(4, e0); bag0.set(7, e1); bag1 = new FloatBag(); bag1.copyFrom(bag0, 3); assertEquals((Float) 0f, (Float) bag1.get(0)); assertEquals((Float) 0f, (Float) bag1.get(1)); assertEquals((Float) 0f, (Float) bag1.get(2)); assertEquals((Float) 0f, (Float) bag1.get(3)); assertEquals((Float) 0f, (Float) bag1.get(4)); assertEquals((Float) 0f, (Float) bag1.get(5)); assertEquals((Float) 0f, (Float) bag1.get(6)); assertEquals((Float) 0f, (Float) bag1.get(7)); bag1 = new FloatBag(); bag1.copyFrom(bag0, 5); assertEquals((Float) 0f, (Float) bag1.get(0)); assertEquals((Float) 0f, (Float) bag1.get(1)); assertEquals((Float) 0f, (Float) bag1.get(2)); assertEquals((Float) 0f, (Float) bag1.get(3)); assertEquals((Float) e0, (Float) bag1.get(4)); assertEquals((Float) 0f, (Float) bag1.get(5)); assertEquals((Float) 0f, (Float) bag1.get(6)); assertEquals((Float) 0f, (Float) bag1.get(7)); bag1 = new FloatBag(); bag1.set(8, e2); bag1.copyFrom(bag0, 8, true); assertEquals((Float) 0f, (Float) bag1.get(0)); assertEquals((Float) 0f, (Float) bag1.get(1)); assertEquals((Float) 0f, (Float) bag1.get(2)); assertEquals((Float) 0f, (Float) bag1.get(3)); assertEquals((Float) e0, (Float) bag1.get(4)); assertEquals((Float) 0f, (Float) bag1.get(5)); assertEquals((Float) 0f, (Float) bag1.get(6)); assertEquals((Float) e1, (Float) bag1.get(7)); assertEquals((Float) 0f, (Float) bag1.get(8)); assertEquals((Float) 0f, (Float) bag1.get(9)); bag0 = new FloatBag(); bag0.set(0, e0); bag0.set(4, e1); bag0.set(6, e2); bag1 = new FloatBag(); bag1.copyFrom(bag0, 3, 2); assertEquals((Float) 0f, (Float) bag1.get(0)); assertEquals((Float) e1, (Float) bag1.get(1)); assertEquals((Float) 0f, (Float) bag1.get(2)); assertEquals((Float) 0f, (Float) bag1.get(3)); assertEquals((Float) 0f, (Float) bag1.get(4)); assertEquals((Float) 0f, (Float) bag1.get(5)); assertEquals((Float) 0f, (Float) bag1.get(6)); assertEquals((Float) 0f, (Float) bag1.get(7)); assertEquals((Float) 0f, (Float) bag1.get(8)); bag0 = new FloatBag(); bag0.set(0, e0); bag0.set(4, e1); bag0.set(10, e2); bag1 = new FloatBag(); bag1.set(7, e3); bag1.copyFrom(bag0, 3, 2, false); assertEquals((Float) 0f, (Float) bag1.get(0)); assertEquals((Float) e1, (Float) bag1.get(1)); assertEquals((Float) 0f, (Float) bag1.get(2)); assertEquals((Float) 0f, (Float) bag1.get(3)); assertEquals((Float) 0f, (Float) bag1.get(4)); assertEquals((Float) 0f, (Float) bag1.get(5)); assertEquals((Float) 0f, (Float) bag1.get(6)); assertEquals((Float) e3, (Float) bag1.get(7)); assertEquals((Float) 0f, (Float) bag1.get(8)); assertEquals((Float) 0f, (Float) bag1.get(9)); assertEquals((Float) 0f, (Float) bag1.get(10)); }
@Override public void copyFrom(FloatBag from) { copyFrom(from, true); }
FloatBag implements AnyBag<FloatBag> { @Override public void copyFrom(FloatBag from) { copyFrom(from, true); } }
FloatBag implements AnyBag<FloatBag> { @Override public void copyFrom(FloatBag from) { copyFrom(from, true); } FloatBag(); }
FloatBag implements AnyBag<FloatBag> { @Override public void copyFrom(FloatBag from) { copyFrom(from, true); } 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 copyFrom(FloatBag from) { copyFrom(from, true); } 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; }