CellAddressのインスタンスを作成する。
@param cell セルのインスタンス。
@return {@link CellPosition}のインスタンス
@throws IllegalArgumentException {@literal cell == null.}
331273
public static CellPosition of(final Cell cell) {
        ArgUtils.notNull(cell, "cell");

        return of(cell.getRowIndex(), cell.getColumnIndex());
    }
126922
public static Cell findCell(Sheet sheet, String cellRefValue) {
        val cellRef = new CellReference(cellRefValue);
        val row = sheet.getRow(cellRef.getRow());
        if (row == null) {
            log.warn("unable to find row for " + cellRefValue);
            return null;
        }

        val cell = row.getCell(cellRef.getCol());
        if (cell == null) {
            log.warn("unable to find cell for " + cellRefValue);
        }

        return cell;
    }
1205115
private Cell newCell(Row tmplRow, int cellCol, int rowOffset, Row row, Object cellValue, int maxLen) {
        val cell = getOrCreateCell(tmplRow, cellCol, rowOffset, row);

        val value = PoiUtil.writeCellValue(cell, cellValue);

        fixMaxRowHeightRatio(row, maxLen, value);
        return cell;
    }
772984
private CellFormatResult getErrorCellValue(final Cell cell, final Locale locale) {

        final CellType cellType = cell.getCellTypeEnum();
        assert cellType == CellType.ERROR;

        return getErrorCellValue(cell.getErrorCellValue(), locale);
    }
13191
public java.lang.String getCellpadding() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.cellpadding);

    }
1199940
public static Hyperlink getHyperlink(final Cell cell) {

        ArgUtils.notNull(cell, "cell");

        Hyperlink link = cell.getHyperlink();
        if(link != null) {
            return link;
        }

        final Sheet sheet = cell.getSheet();
        CellRangeAddress mergedRange = getMergedRegion(sheet, cell.getRowIndex(), cell.getColumnIndex());
        if(mergedRange == null) {
            return null;
        }

        for(Hyperlink item : sheet.getHyperlinkList()) {
            if(item.getFirstRow() == mergedRange.getFirstRow()
                    && item.getFirstColumn() == mergedRange.getFirstColumn()) {
                return item;
            }

        }

        return null;

    }
782025
public Cell<?> applyPadding (final Cell<?> cell) {
		cell.pad(top, left, bottom, right);
		return cell;
	}
1259958
public static Cell getOrCreateCell(Row row, int cellIndex) {
		Cell cell = row.getCell(cellIndex);
		if (null == cell) {
			cell = row.createCell(cellIndex);
		}
		return cell;
	}
982882
public void setupCellPositoin(final CellPosition address) {
        ArgUtils.notNull(address, "address");
        setupCellPositoin(address.getRow(), address.getColumn());
    }
594839
public GridCell<P> createCellAt(int row, int column) {
		GridCell<P> cell = this.cells[row][column];
		if (cell == null) {
			cell = new GridCell<>(row, column, getCellBounds(row, column));
			this.cells[row][column] = cell;
			++this.cellCount;
		}
		return cell;
	}
300984
public void addCell(Cell aCell, Point aLocation) throws BadElementException {
        if (aCell == null) throw new NullPointerException("addCell - cell has null-value");
        if (aLocation == null) throw new NullPointerException("addCell - point has null-value");
        if (aCell.isTable()) insertTable((Table)aCell.getElements().next(), aLocation);
        
        if (aLocation.x < 0) throw new BadElementException("row coordinate of location must be >= 0");
        if ((aLocation.y <= 0) && (aLocation.y > columns)) throw new BadElementException("column coordinate of location must be >= 0 and < nr of columns");
        if (!isValidLocation(aCell, aLocation)) throw new BadElementException("Adding a cell at the location (" + aLocation.x + "," + aLocation.y + ") with a colspan of " + aCell.getColspan() + " and a rowspan of " + aCell.getRowspan() + " is illegal (beyond boundaries/overlapping).");
        
        if (aCell.getBorder() == UNDEFINED) aCell.setBorder(defaultCell.getBorder());
        aCell.fill();
        placeCell(rows, aCell, aLocation);
        setCurrentLocationToNextValidPosition(aLocation);
    }
473160
public static Object getCellValue(HSSFCell cell) {
    if ((cell == null)) return null;
    switch (cell.getCellTypeEnum()) {
    case BLANK:
      return null;
    case STRING:
      return Strings.trim(cell.getRichStringCellValue().getString());
    case NUMERIC:
      if (DateUtil.isCellDateFormatted(cell)) {
        return cell.getDateCellValue();
      } else {
        return numberFormat.format(cell.getNumericCellValue());
      }
    case BOOLEAN:
      return (cell.getBooleanCellValue()) ? Boolean.TRUE : Boolean.FALSE;
    default:
      // cannot handle HSSFCell.CELL_TYPE_ERROR,HSSFCell.CELL_TYPE_FORMULA
      return null;
    }
  }
173271
@SuppressWarnings("squid:S2259") // Null pointers should not be dereferenced
  void setCellValue(Cell cell, Object value) {
    if (value instanceof Boolean) {
      cell.setCellValue(toBoolean(value));
    } else if (value instanceof LocalDate) {
      Instant instant = toLocalDate(value).atStartOfDay(timeZone.toZoneId()).toInstant();
      cell.setCellValue(simpleDateFormat.format(Date.from(instant)));
    } else if (value instanceof Instant) {
      cell.setCellValue(simpleDateTimeFormat.format(Date.from((Instant) value)));
    } else if (value instanceof Double) {
      cell.setCellValue(toDouble(value));
    } else if (value instanceof Integer) {
      cell.setCellValue(toInt(value));
    } else if (value instanceof Long) {
      cell.setCellValue(toLong(value));
    } else if (value instanceof String) {
      cell.setCellValue(value.toString());
    } else {
      throw new UnsupportedValueException(value);
    }
  }
268922
public static CellRangeAddress mergeCells(final Sheet sheet, int startCol, int startRow, int endCol, int endRow) {
        ArgUtils.notNull(sheet, "sheet");

        // 結合先のセルの値を空に設定する
        for(int r=startRow; r <= endRow; r++) {
            for(int c=startCol; c <= endCol; c++) {

                if(r == startRow && c == startCol) {
                    continue;
                }

                Cell cell = getCell(sheet, c, r);
                cell.setCellType(CellType.BLANK);
            }
        }

        final CellRangeAddress range = new CellRangeAddress(startRow, endRow, startCol, endCol);
        sheet.addMergedRegion(range);
        return range;
    }
976666
public CellFormatResult format(final Cell cell, final Locale locale) {

        if(cell == null) {
            return createBlankCellResult();
        }

        final Locale runtimeLocale = locale != null ? locale : Locale.getDefault();

        switch(cell.getCellTypeEnum()) {
            case BLANK:
                if(isConsiderMergedCell()) {
                    // 結合しているセルの場合、左上のセル以外に値が設定されている場合がある。
                    return getMergedCellValue(cell, runtimeLocale);
                } else {
                    return createBlankCellResult();
                }

            case BOOLEAN:
                return getCellValue(cell, runtimeLocale);

            case STRING:
                return getCellValue(cell, runtimeLocale);

            case NUMERIC:
                return getCellValue(cell, runtimeLocale);

            case FORMULA:
                return getFormulaCellValue(cell, runtimeLocale);

            case ERROR:
                return getErrorCellValue(cell, runtimeLocale);

            default:
                final CellFormatResult result = new CellFormatResult();
                result.setCellType(FormatCellType.Unknown);
                result.setText("");
                return result;
        }
    }
201570
public static Cell setCellValue(Cell cell, Object value, String dateFormat) {
        SimpleDateFormat format =
                new SimpleDateFormat(StringUtils.isNotBlank(dateFormat) ? dateFormat : DATE_PATTERN);
        if (value == null) {
            cell.setCellValue("");
        } else if (value instanceof String) {
            cell.setCellValue((String) value);
        } else if (value instanceof Integer) {
            cell.setCellValue((Integer) value);
        } else if (value instanceof Date) {
            cell.setCellValue(format.format(value));
        } else if (value instanceof Calendar) {
            cell.setCellValue(format.format(((Calendar) value).getTime()));
        } else if (value instanceof Boolean) {
            cell.setCellValue((Boolean) value);
        } else if (value instanceof Float) {
            cell.setCellValue((Float) value);
        } else if (value instanceof Double) {
            cell.setCellValue((Double) value);
        } else if (value instanceof Byte) {
            cell.setCellValue((Byte) value);
        } else if (value instanceof Short) {
            cell.setCellValue((Short) value);
        } else if (value instanceof Long) {
            cell.setCellValue((Long) value);
        } else if (value instanceof Character) {
            cell.setCellValue(((Character) value).toString());
        } else {
            cell.setCellValue(value.toString());
        }
        return cell;
    }
1227386
public CellFinder startPosition(final CellPosition address) {
        ArgUtils.notNull(address, "address");
        
        return startPosition(address.getColumn(), address.getRow());
    }