1 23 package org.objectweb.medor.eval.lib; 24 25 import org.objectweb.medor.api.EvaluationException; 26 import org.objectweb.medor.eval.api.ConnectionResources; 27 import org.objectweb.medor.query.api.QueryLeaf; 28 29 import java.util.HashMap ; 30 31 public class MedorConnectionResources implements ConnectionResources { 32 33 HashMap map; 34 35 public MedorConnectionResources(HashMap map) { 36 this.map = map; 37 } 38 39 public Object getConnection(QueryLeaf ql) { 40 return map.get(ql); 41 } 42 43 public void setConnection(QueryLeaf ql, Object connection) 44 throws EvaluationException { 45 map.put(ql, connection); 46 } 47 48 public QueryLeaf[] getRequiredQueryLeafConnection() { 49 return (QueryLeaf[]) map.keySet().toArray(new QueryLeaf[0]); 50 } 51 } 52 | Popular Tags |