double cell value


I guess, the solution is rather easy but I don't get the problem...

My node throws an error when it tries to read the double value of a double cell. As I also allow to process int cells, the statement I've use looks like this:

DataCell valueCell = row.getCell(colIdx);
Double value = null;
if (!valueCell.isMissing()) value = ((IntCell) valueCell).getDoubleValue();

If I debug the code in IntelliJ and evaluate the expression I don't get any error...

The error I get in KNIME is this one:

ERROR     BinningAnalysis     Execute failed: cannot be cast to
DEBUG     BinningAnalysis     Execute failed: cannot be cast to
java.lang.ClassCastException: cannot be cast to
    at de.mpicbg.tds.knime.hcstools.populationanalysis.BinningAnalysisNodeModel.execute(
    at org.knime.core.node.NodeModel.execute(
    at org.knime.core.node.NodeModel.executeModel(
    at org.knime.core.node.Node.execute(
    at org.knime.core.node.workflow.SingleNodeContainer.performExecuteNode(
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(
    at java.util.concurrent.Executors$
    at java.util.concurrent.FutureTask$Sync.innerRun(
    at org.knime.core.util.ThreadPool$
    at org.knime.core.util.ThreadPool$

What is wrong with my code?

you're using intCells instead of doublecells should be:
if (!valueCell.isMissing()) value = ((DoubleCell) valueCell).getDoubleValue();

btw, it would anyway be better to convert to doublevalue, which than works for ints and doubles.

if (!valueCell.isMissing()) value = ((DoubleValue) valueCell).getDoubleValue();

Thanks a lot for the second hint (I had to compare it three times with the upper line to get the difference that I need to cast to DoubleValue instead of DoubleCell).

I was probably mislead because of the method getDoubleValue() from class IntCell.

That's exaclty what I need as I don't care whether the numeric value comes from an int cell or a double cell.