}
private TypedResult compute() throws CompilerException
{
final ExpressionNodeForCellModel cellNode = (ExpressionNodeForCellModel) node();
final CellModel cellModel = cellNode.getCellModel();
if (null == cellModel) {
return ConstResult.NULL;
}
if (cellModel.isInput()) {
return node();
}
final Object constantValue = cellModel.getConstantValue();
if (null != constantValue) {
if (constantValue instanceof Boolean) {
boolean bool = ((Boolean) constantValue).booleanValue();
return new ConstResult( type().adjustConstantValue( Double.valueOf( bool ? 1 : 0 ) ),
cellModel.getDataType() );
}
return cellModel;
}
final ExpressionNode expression = cellModel.getExpression();
if (null != expression) {
final TypedResult constResult = EvalShadow.evaluate( expression, type() );
if (constResult instanceof ExpressionNode) {
// Do not need to clone leaf node.