/** * Converts argument to DoubleCell if it does not fully support the DataValue interfaces supported * by DoubleCell.TYPE . * * @param cell Cell to convert (or not) * @return The argument or a new DoubleCell. */ private DataCell convertToDoubleCellIfNecessary(final DataCell cell) { if (cell.isMissing()) { return DataType.getMissingCell(); } if (TYPE.isASuperTypeOf(cell.getType())) { return cell; } return new DoubleCell(((DoubleValue) cell).getDoubleValue()); }