1 package org.simantics.graph.compiler.internal.templates;
3 import gnu.trove.map.hash.TIntIntHashMap;
5 import java.util.ArrayList;
6 import java.util.Collection;
8 import org.simantics.graph.store.IStore;
9 import org.simantics.graph.store.IndexMappingUtils;
11 public class TemplateInstanceStore implements IStore {
12 ArrayList<int[]> templateInstances;
14 public TemplateInstanceStore(ArrayList<int[]> templateInstances) {
15 this.templateInstances = templateInstances;
18 public TemplateInstanceStore() {
19 this(new ArrayList<int[]>());
23 public void map(final TIntIntHashMap map) {
24 for(int[] templateInstance : templateInstances)
25 IndexMappingUtils.map(map, templateInstance);
28 public Collection<int[]> getTemplateInstances() {
29 return templateInstances;
32 public void add(int[] templateInstance) {
33 templateInstances.add(templateInstance);