1 package org.simantics.sysdyn.modelImport.model.expression;
\r
3 import java.util.ArrayList;
\r
4 import java.util.HashMap;
\r
5 import java.util.List;
\r
7 import org.simantics.db.Resource;
\r
8 import org.simantics.db.WriteGraph;
\r
9 import org.simantics.db.exception.DatabaseException;
\r
10 import org.simantics.sysdyn.modelImport.model.WriteContext;
\r
12 public class SubscriptExpression implements IExpression {
\r
14 private ArrayList<SubscriptExpressionElement> elements;
\r
16 public SubscriptExpression(String[] indices, IExpression expression) {
\r
17 elements = new ArrayList<SubscriptExpressionElement>();
\r
18 elements.add(new SubscriptExpressionElement(indices, expression));
\r
21 public List<SubscriptExpressionElement> getElements() {
\r
25 public void merge(SubscriptExpression other) {
\r
26 elements.addAll(other.getElements());
\r
30 public void write(WriteGraph graph, Resource parent, WriteContext context)
\r
31 throws DatabaseException {
\r
32 System.err.println("write subscript expression");
\r
35 private class SubscriptExpressionElement {
\r
38 IExpression expression;
\r
40 public SubscriptExpressionElement(String[] indices, IExpression expression) {
\r
41 this.indices = indices;
\r
42 this.expression = expression;
\r