X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Fstore%2FLocationStore.java;fp=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Fstore%2FLocationStore.java;h=3c3799bf7561f536f030873ffef1237a4ab91c3a;hp=a6cf28987091a6d0163ef6b0f756159302a773bd;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/store/LocationStore.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/store/LocationStore.java index a6cf28987..3c3799bf7 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/store/LocationStore.java +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/store/LocationStore.java @@ -1,36 +1,36 @@ -package org.simantics.graph.compiler.internal.store; - -import gnu.trove.map.hash.TIntIntHashMap; -import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.set.hash.TIntHashSet; - -import org.simantics.graph.store.IStore; -import org.simantics.graph.store.IndexMappingUtils; -import org.simantics.ltk.Location; - -public class LocationStore implements IStore { - - TIntObjectHashMap locations; - - public LocationStore(TIntObjectHashMap locations) { - this.locations = locations; - } - - public LocationStore() { - this(new TIntObjectHashMap()); - } - - @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); - } - -} +package org.simantics.graph.compiler.internal.store; + +import gnu.trove.map.hash.TIntIntHashMap; +import gnu.trove.map.hash.TIntObjectHashMap; +import gnu.trove.set.hash.TIntHashSet; + +import org.simantics.graph.store.IStore; +import org.simantics.graph.store.IndexMappingUtils; +import org.simantics.ltk.Location; + +public class LocationStore implements IStore { + + TIntObjectHashMap locations; + + public LocationStore(TIntObjectHashMap locations) { + this.locations = locations; + } + + public LocationStore() { + this(new TIntObjectHashMap()); + } + + @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); + } + +}