Skip to content

Commit

Permalink
refactor: 매직넘버를 불변상수화
Browse files Browse the repository at this point in the history
  • Loading branch information
coli-geonwoo committed Jan 10, 2025
1 parent 8765494 commit 6a051fb
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class ParliamentaryTableExcelExporter {
private static final int AGENDA_HEADER_ROW_NUMBER = 3;
private static final int TABLE_HEADER_ROW_NUMBER = 5;
private static final int TIME_BOX_FIRST_ROW_NUMBER = 6;
private static final int END_COLUMN_NUMBER = 3;
private static final int WIDTH_SIZE = 10000;

private final ParliamentaryTableExportMessageResolver messageResolver;

Expand Down Expand Up @@ -113,8 +115,7 @@ public Workbook export(ParliamentaryTable table, ParliamentaryTimeBoxes timeBoxe

createTableHeader(sheet, TABLE_HEADER_ROW_NUMBER);
createTimeBoxRows(timeBoxes, sheet);

setColumnWidth(sheet, 3, 10000);
setColumnWidth(sheet);
return workbook;
}

Expand All @@ -141,9 +142,9 @@ private void createCell(Row row, int index, String value, CellStyle style) {
cell.setCellValue(value);
}

private void setColumnWidth(Sheet sheet, int columnNumber, int widthSize) {
for (int i = 0; i < columnNumber; i++) {
sheet.setColumnWidth(i, widthSize);
private void setColumnWidth(Sheet sheet) {
for (int i = 0; i < END_COLUMN_NUMBER; i++) {
sheet.setColumnWidth(i, WIDTH_SIZE);
}
}

Expand Down

0 comments on commit 6a051fb

Please sign in to comment.