1 package org.simantics.spreadsheet.graph.formula;
3 import org.simantics.spreadsheet.graph.CellFormulaFunction;
4 import org.simantics.spreadsheet.graph.CellValueVisitor;
5 import org.simantics.spreadsheet.graph.SpreadsheetGraphUtils;
6 import org.simantics.spreadsheet.graph.parser.ast.AstArgList;
8 public class OrFormulaFunction implements CellFormulaFunction<Object> {
11 public Object evaluate(CellValueVisitor visitor, AstArgList args) {
12 if (args.values.size() == 0) throw new IllegalStateException();
14 for (int i = 0; i < args.values.size(); i++) {
17 obj = args.values.get(i).accept(visitor);
18 } catch (IllegalStateException e){
19 return FormulaError2.NAME.getString();
21 FormulaError2 error = FormulaError2.forObject(obj);
22 if(error!=null) return error.getString();
24 if (SpreadsheetGraphUtils.asBoolean(obj))