@Test(expected = Exception.class) public void emptyMerge() throws Exception { (new DataSection()).mergeX(); }
public void mergeX() throws Exception { if (this.matrix == null) { throw new Exception("The section has not been converted to a matrix"); } for (Integer y = 0; y <= getMaxY(); y++) { for (Integer x = 0; x <= getMaxX(); x++) { DataCell cell = this.matrix[x][y]; if (cell == null) { continue; } Integer nextX = x + 1; while (nextX <= getMaxX() && this.matrix[nextX][y] == null) { cell.addMergeX(); nextX++; } } } }
DataSection { public void mergeX() throws Exception { if (this.matrix == null) { throw new Exception("The section has not been converted to a matrix"); } for (Integer y = 0; y <= getMaxY(); y++) { for (Integer x = 0; x <= getMaxX(); x++) { DataCell cell = this.matrix[x][y]; if (cell == null) { continue; } Integer nextX = x + 1; while (nextX <= getMaxX() && this.matrix[nextX][y] == null) { cell.addMergeX(); nextX++; } } } } }
DataSection { public void mergeX() throws Exception { if (this.matrix == null) { throw new Exception("The section has not been converted to a matrix"); } for (Integer y = 0; y <= getMaxY(); y++) { for (Integer x = 0; x <= getMaxX(); x++) { DataCell cell = this.matrix[x][y]; if (cell == null) { continue; } Integer nextX = x + 1; while (nextX <= getMaxX() && this.matrix[nextX][y] == null) { cell.addMergeX(); nextX++; } } } }  }
DataSection { public void mergeX() throws Exception { if (this.matrix == null) { throw new Exception("The section has not been converted to a matrix"); } for (Integer y = 0; y <= getMaxY(); y++) { for (Integer x = 0; x <= getMaxX(); x++) { DataCell cell = this.matrix[x][y]; if (cell == null) { continue; } Integer nextX = x + 1; while (nextX <= getMaxX() && this.matrix[nextX][y] == null) { cell.addMergeX(); nextX++; } } } }  void addCell(DataCell cell); void finalizeToMatrix(); void mergeX(); Set<DataCell> getCellList(); DataCell[][] getMatrix(); Integer getMaxX(); Integer getMaxY(); }
DataSection { public void mergeX() throws Exception { if (this.matrix == null) { throw new Exception("The section has not been converted to a matrix"); } for (Integer y = 0; y <= getMaxY(); y++) { for (Integer x = 0; x <= getMaxX(); x++) { DataCell cell = this.matrix[x][y]; if (cell == null) { continue; } Integer nextX = x + 1; while (nextX <= getMaxX() && this.matrix[nextX][y] == null) { cell.addMergeX(); nextX++; } } } }  void addCell(DataCell cell); void finalizeToMatrix(); void mergeX(); Set<DataCell> getCellList(); DataCell[][] getMatrix(); Integer getMaxX(); Integer getMaxY();  }