@Test public void testClone() { byte[][] data = QuadraticArrays.parse( "000000000", "111111111", "222222222", "333333333", "444444444", "555555555", "666666666", "777777777", "888888888" ); GameMatrixImpl matrix = new GameMatrixImpl(); matrix.setAll(data); GameMatrixImpl clone = (GameMatrixImpl) matrix.clone(); String out = clone.toString(); assertEquals("_________\n"+ "111111111\n"+ "222222222\n"+ "333333333\n"+ "444444444\n"+ "555555555\n"+ "666666666\n"+ "777777777\n"+ "888888888\n" , out); }
@Override public Object clone() { GameMatrixImpl clone; try { clone = (GameMatrixImpl) super.clone(); clone.data = QuadraticArrays.cloneArray(data); } catch (CloneNotSupportedException ex) { throw new IllegalStateException(); } return clone; }
GameMatrixImpl implements Cloneable, BitFreeMatrixInterface { @Override public Object clone() { GameMatrixImpl clone; try { clone = (GameMatrixImpl) super.clone(); clone.data = QuadraticArrays.cloneArray(data); } catch (CloneNotSupportedException ex) { throw new IllegalStateException(); } return clone; } }
GameMatrixImpl implements Cloneable, BitFreeMatrixInterface { @Override public Object clone() { GameMatrixImpl clone; try { clone = (GameMatrixImpl) super.clone(); clone.data = QuadraticArrays.cloneArray(data); } catch (CloneNotSupportedException ex) { throw new IllegalStateException(); } return clone; } GameMatrixImpl(); }
GameMatrixImpl implements Cloneable, BitFreeMatrixInterface { @Override public Object clone() { GameMatrixImpl clone; try { clone = (GameMatrixImpl) super.clone(); clone.data = QuadraticArrays.cloneArray(data); } catch (CloneNotSupportedException ex) { throw new IllegalStateException(); } return clone; } GameMatrixImpl(); @Override final void setAll(final byte[][] initializationData); @Override final void clear(); @Override final byte get(final int row, final int column); @Override void set(final int row, final int column, final byte value); @Override int getSetCount(); @Override final byte[][] getArray(); @Override final String toString(); @Override int hashCode(); @Override final boolean equals(final Object obj); @Override Object clone(); @Override final boolean isValid(); @Override int getFreeMask(
            final int row,
            final int column); @Override final boolean canSet(
            final int row,
            final int column,
            final byte value); }
GameMatrixImpl implements Cloneable, BitFreeMatrixInterface { @Override public Object clone() { GameMatrixImpl clone; try { clone = (GameMatrixImpl) super.clone(); clone.data = QuadraticArrays.cloneArray(data); } catch (CloneNotSupportedException ex) { throw new IllegalStateException(); } return clone; } GameMatrixImpl(); @Override final void setAll(final byte[][] initializationData); @Override final void clear(); @Override final byte get(final int row, final int column); @Override void set(final int row, final int column, final byte value); @Override int getSetCount(); @Override final byte[][] getArray(); @Override final String toString(); @Override int hashCode(); @Override final boolean equals(final Object obj); @Override Object clone(); @Override final boolean isValid(); @Override int getFreeMask(
            final int row,
            final int column); @Override final boolean canSet(
            final int row,
            final int column,
            final byte value);  }