1 package org.simantics.spreadsheet.graph.formula;
\r
3 import org.simantics.spreadsheet.graph.CellFormulaFunction;
\r
4 import org.simantics.spreadsheet.graph.CellValueVisitor;
\r
5 import org.simantics.spreadsheet.graph.parser.ast.AstArgList;
\r
7 public class IsErrorFormulaFunction implements CellFormulaFunction<Object>{
\r
10 public Object evaluate(CellValueVisitor visitor, AstArgList args) {
\r
12 if (args.values.size() != 1) throw new IllegalStateException();
\r
14 Object condition = args.values.get(0).accept(visitor);
\r
15 if(condition instanceof String){
\r
16 FormulaError2 error = FormulaError2.forString((String)condition);
\r
17 return (error!=null);
\r