1 package iotpolicy.tree;
3 import java.util.HashMap;
6 /** Abstract class Declaration is a parent class of InterfaceDecl,
7 * CapabilityDecl, and RequiresDecl
9 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
13 public class DeclarationHandler {
18 private Map<String,Declaration> mapInt2IntfaceDecl;
19 private Map<String,Declaration> mapInt2CapabDecl;
20 private Map<String,Declaration> mapInt2ReqDecl;
25 public DeclarationHandler() {
27 mapInt2IntfaceDecl = new HashMap<String,Declaration>();
28 mapInt2CapabDecl = new HashMap<String,Declaration>();
29 mapInt2ReqDecl = new HashMap<String,Declaration>();
36 public void addInterfaceDecl(String origInt, Declaration intDecl) {
38 mapInt2IntfaceDecl.put(origInt, intDecl);
42 public void addCapabilityDecl(String origInt, Declaration capDecl) {
44 mapInt2CapabDecl.put(origInt, capDecl);
48 public void addRequiresDecl(String origInt, Declaration reqDecl) {
50 mapInt2ReqDecl.put(origInt, reqDecl);
57 public Declaration getInterfaceDecl(String origInt) {
59 return mapInt2IntfaceDecl.get(origInt);
63 public Declaration getCapabilityDecl(String origInt) {
65 return mapInt2CapabDecl.get(origInt);
69 public Declaration getRequiresDecl(String origInt) {
71 return mapInt2ReqDecl.get(origInt);