X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fvariable%2FVariableMapImpl.java;h=5b6aa082001a4ae2be5f0547c3e983db9569c508;hb=15af8a20abe8b2ba24b52c9da8bce6c92351dc43;hp=2ab7e74660b63753b764d010a4784c876014f90d;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableMapImpl.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableMapImpl.java index 2ab7e7466..5b6aa0820 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableMapImpl.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableMapImpl.java @@ -1,35 +1,35 @@ -package org.simantics.db.layer0.variable; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.simantics.db.ReadGraph; -import org.simantics.db.exception.DatabaseException; - -abstract public class VariableMapImpl implements VariableMap { - - @Override - public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException { - return getVariables(graph, context, null).get(name); - } - - @Override - public Map getVariables(ReadGraph graph, Variable context, String classification, Map map) throws DatabaseException { - - Map all = getVariables(graph, context, null); - if(all.isEmpty()) return all; - - for(Map.Entry entry : all.entrySet()) { - Set classifications = entry.getValue().getClassifications(graph); - if(classifications.contains(classification)) { - if(map == null) map = new HashMap(); - map.put(entry.getKey(), entry.getValue()); - } - } - - return map; - - } - -} +package org.simantics.db.layer0.variable; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; + +abstract public class VariableMapImpl implements VariableMap { + + @Override + public Variable getVariable(ReadGraph graph, Variable context, String name) throws DatabaseException { + return getVariables(graph, context, null).get(name); + } + + @Override + public Map getVariables(ReadGraph graph, Variable context, String classification, Map map) throws DatabaseException { + + Map all = getVariables(graph, context, null); + if(all.isEmpty()) return all; + + for(Map.Entry entry : all.entrySet()) { + Set classifications = entry.getValue().getClassifications(graph); + if(classifications.contains(classification)) { + if(map == null) map = new HashMap(); + map.put(entry.getKey(), entry.getValue()); + } + } + + return map; + + } + +}