1 package org.simantics.databoard.example;
3 import org.simantics.databoard.Accessors;
4 import org.simantics.databoard.Bindings;
5 import org.simantics.databoard.accessor.Accessor;
6 import org.simantics.databoard.accessor.error.AccessorConstructionException;
7 import org.simantics.databoard.accessor.error.AccessorException;
8 import org.simantics.databoard.accessor.reference.ChildReference;
9 import org.simantics.databoard.binding.Binding;
10 import org.simantics.databoard.binding.error.BindingConstructionException;
12 public class AccessorReference {
14 public static void main(String[] args) throws BindingConstructionException, AccessorConstructionException, AccessorException {
17 int[][] data = new int[100][100];
19 Accessor a = Accessors.getAccessor(data);
22 String reference = "i-4/i-5";
23 ChildReference ref = ChildReference.parsePath( reference );
24 a.getComponent(ref).setValue(Bindings.INTEGER, 100);
25 System.out.println(data[4][5]);
29 ref = ChildReference.parsePath( reference );
30 a.getComponent(ref).setValue(Bindings.INTEGER, -100);
31 System.out.println(data[4][5]);