package org.simantics.spreadsheet.graph; import java.io.Serializable; import org.simantics.databoard.binding.mutable.Variant; import org.simantics.spreadsheet.graph.formula.FormulaError2; public class SpreadsheetMatrix implements Serializable { private static final long serialVersionUID = 5729700370527844640L; private int w; private int h; public Object[] values; public SpreadsheetMatrix(int w, int h) { this.w = w; this.h = h; this.values = new Object[w*h]; } public Object get(int row, int column) { return values[w*row+column]; } public void set(int row, int column, Object value) { values[w*row+column] = value; } public int getWidth() { return w; } public int getHeight() { return h; } public double sum() { double result = 0; for(int i=0;i