@Test public void testGetRowFreeMask() { byte[][] data = QuadraticArrays.parse( "100000000", "020100000", "000320100", "010000456", "000010000", "000000010", "001000000", "000001000", "000000001" ); GameMatrixImpl matrix = new GameMatrixImpl(); matrix.setAll(data); int mask = matrix.getRowFreeMask(0); assertEquals(BitFreeMatrixInterface.MASK_FOR_NINE_BITS & (~(1<<1)), mask); mask = matrix.getRowFreeMask(1); assertEquals(BitFreeMatrixInterface.MASK_FOR_NINE_BITS & (~((1<<1) | (1<<2))), mask); mask = matrix.getRowFreeMask(2); assertEquals(BitFreeMatrixInterface.MASK_FOR_NINE_BITS & (~((1<<1) | (1<<2) | (1<<3))), mask); mask = matrix.getRowFreeMask(3); assertEquals(BitFreeMatrixInterface.MASK_FOR_NINE_BITS & (~((1<<1) | (1<<4) | (1<<5) | (1<<6))), mask); }
protected int getRowFreeMask(final int row) { byte[] tmpData = new byte[GameMatrix.SIZE]; row(row, tmpData); return (~getNumberMask(tmpData)) & MASK_FOR_NINE_BITS; }
GameMatrixImpl implements Cloneable, BitFreeMatrixInterface { protected int getRowFreeMask(final int row) { byte[] tmpData = new byte[GameMatrix.SIZE]; row(row, tmpData); return (~getNumberMask(tmpData)) & MASK_FOR_NINE_BITS; } }
GameMatrixImpl implements Cloneable, BitFreeMatrixInterface { protected int getRowFreeMask(final int row) { byte[] tmpData = new byte[GameMatrix.SIZE]; row(row, tmpData); return (~getNumberMask(tmpData)) & MASK_FOR_NINE_BITS; } GameMatrixImpl(); }
GameMatrixImpl implements Cloneable, BitFreeMatrixInterface { protected int getRowFreeMask(final int row) { byte[] tmpData = new byte[GameMatrix.SIZE]; row(row, tmpData); return (~getNumberMask(tmpData)) & MASK_FOR_NINE_BITS; } 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 { protected int getRowFreeMask(final int row) { byte[] tmpData = new byte[GameMatrix.SIZE]; row(row, tmpData); return (~getNumberMask(tmpData)) & MASK_FOR_NINE_BITS; } 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);  }