-package org.simantics.graph.compiler.internal.store;\r
-\r
-import gnu.trove.map.hash.TIntIntHashMap;\r
-import gnu.trove.map.hash.TIntObjectHashMap;\r
-import gnu.trove.set.hash.TIntHashSet;\r
-\r
-import org.simantics.graph.store.IStore;\r
-import org.simantics.graph.store.IndexMappingUtils;\r
-import org.simantics.ltk.Location;\r
-\r
-public class LocationStore implements IStore {\r
- \r
- TIntObjectHashMap<Location> locations;\r
-\r
- public LocationStore(TIntObjectHashMap<Location> locations) {\r
- this.locations = locations;\r
- }\r
-\r
- public LocationStore() {\r
- this(new TIntObjectHashMap<Location>());\r
- }\r
-\r
- @Override\r
- public void map(TIntIntHashMap map) {\r
- locations = IndexMappingUtils.map(map, locations, new TIntHashSet());\r
- }\r
- \r
- public Location getLocation(int id) {\r
- return locations.get(id);\r
- }\r
-\r
- public void add(int resource, Location tree) {\r
- locations.putIfAbsent(resource, tree); \r
- }\r
-\r
-}\r
+package org.simantics.graph.compiler.internal.store;
+
+import org.simantics.graph.compiler.internal.ltk.Location;
+import org.simantics.graph.store.IStore;
+import org.simantics.graph.store.IndexMappingUtils;
+
+import gnu.trove.map.hash.TIntIntHashMap;
+import gnu.trove.map.hash.TIntObjectHashMap;
+import gnu.trove.set.hash.TIntHashSet;
+
+public class LocationStore implements IStore {
+
+ TIntObjectHashMap<Location> locations;
+
+ public LocationStore(TIntObjectHashMap<Location> locations) {
+ this.locations = locations;
+ }
+
+ public LocationStore() {
+ this(new TIntObjectHashMap<Location>());
+ }
+
+ @Override
+ public void map(TIntIntHashMap map) {
+ locations = IndexMappingUtils.map(map, locations, new TIntHashSet());
+ }
+
+ public Location getLocation(int id) {
+ return locations.get(id);
+ }
+
+ public void add(int resource, Location tree) {
+ locations.putIfAbsent(resource, tree);
+ }
+
+}