@Test public void testClone() throws Exception { OrderedIntDoubleMapping mapping = new OrderedIntDoubleMapping(1); mapping.set(0, 1.1); mapping.set(5, 6.6); OrderedIntDoubleMapping clone = mapping.clone(); assertEquals(2, clone.getNumMappings()); assertEquals(1.1, clone.get(0), EPSILON); assertEquals(0.0, clone.get(1), EPSILON); assertEquals(6.6, clone.get(5), EPSILON); assertEquals(0.0, clone.get(6), EPSILON); }
@SuppressWarnings("CloneDoesntCallSuperClone") @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); }
OrderedIntDoubleMapping implements Serializable, Cloneable { @SuppressWarnings("CloneDoesntCallSuperClone") @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } }
OrderedIntDoubleMapping implements Serializable, Cloneable { @SuppressWarnings("CloneDoesntCallSuperClone") @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } OrderedIntDoubleMapping(boolean noDefault);   OrderedIntDoubleMapping();   OrderedIntDoubleMapping(int capacity);   OrderedIntDoubleMapping(int[] indices, double[] values, int numMappings); }
OrderedIntDoubleMapping implements Serializable, Cloneable { @SuppressWarnings("CloneDoesntCallSuperClone") @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } OrderedIntDoubleMapping(boolean noDefault);   OrderedIntDoubleMapping();   OrderedIntDoubleMapping(int capacity);   OrderedIntDoubleMapping(int[] indices, double[] values, int numMappings); int[] getIndices(); int indexAt(int offset); void setIndexAt(int offset, int index); double[] getValues(); void setValueAt(int offset, double value); int getNumMappings(); double get(int index); void set(int index, double value); void merge(OrderedIntDoubleMapping updates); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); @SuppressWarnings("CloneDoesntCallSuperClone") @Override OrderedIntDoubleMapping clone(); void increment(int index, double increment); }
OrderedIntDoubleMapping implements Serializable, Cloneable { @SuppressWarnings("CloneDoesntCallSuperClone") @Override public OrderedIntDoubleMapping clone() { return new OrderedIntDoubleMapping(indices.clone(), values.clone(), numMappings); } OrderedIntDoubleMapping(boolean noDefault);   OrderedIntDoubleMapping();   OrderedIntDoubleMapping(int capacity);   OrderedIntDoubleMapping(int[] indices, double[] values, int numMappings); int[] getIndices(); int indexAt(int offset); void setIndexAt(int offset, int index); double[] getValues(); void setValueAt(int offset, double value); int getNumMappings(); double get(int index); void set(int index, double value); void merge(OrderedIntDoubleMapping updates); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); @SuppressWarnings("CloneDoesntCallSuperClone") @Override OrderedIntDoubleMapping clone(); void increment(int index, double increment);  }