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