private TableBuilder addBorder(int top, int left, int bottom, int right, int match, BorderStyle style) { Assert.isTrue(top >= 0 && top < rows, "top row must be positive and less than total number of rows"); Assert.isTrue(left >= 0 && left < columns, "left column must be positive and less than total number of columns"); Assert.isTrue(bottom > top && bottom <= rows, "bottom row must be greater than top and less than total number of rows"); Assert.isTrue(right >= left && right <= columns, "right column must be greater than left and less than total number of columns"); Assert.notNull(style, "style cannot be null"); borderSpecifications.add(new BorderSpecification(top, left, bottom, right, match, style)); return this; }
@Override public String toString() { return String.format("%s[(%d, %d)->(%d, %d), %s, %s]", getClass().getSimpleName(), row1, column1, row2, column2, style, matchConstants()); }
for (BorderSpecification bs : borderSpecifications) { if (row < rows) { char verticalThere = bs.verticals(row, column); if (verticalThere != BorderStyle.NONE) { this.verticals[row][column] = verticalThere; char horizontalThere = bs.horizontals(row, column); if (horizontalThere != BorderStyle.NONE) { this.horizontals[row][column] = horizontalThere;