1 package Analysis.SSJava;
3 import java.util.HashMap;
4 import java.util.HashSet;
8 public abstract class LocationSummary {
10 Map<String, String> mapHNodeNameToLocationName;
11 Map<String, Set<String>> mapLocationNameToHNodeNameSet;
13 public LocationSummary() {
14 mapHNodeNameToLocationName = new HashMap<String, String>();
15 mapLocationNameToHNodeNameSet = new HashMap<String, Set<String>>();
18 public void addMapHNodeNameToLocationName(String nodeName, String locName) {
19 // System.out.println("nodeName="+nodeName+" locName="+locName);
20 mapHNodeNameToLocationName.put(nodeName, locName);
22 if (!mapLocationNameToHNodeNameSet.containsKey(locName)) {
23 mapLocationNameToHNodeNameSet.put(locName, new HashSet<String>());
25 mapLocationNameToHNodeNameSet.get(locName).add(nodeName);
28 public Set<String> getHNodeNameSetByLatticeLoationName(String locName) {
29 return mapLocationNameToHNodeNameSet.get(locName);
32 public String getLocationName(String nodeName) {
33 if (!mapHNodeNameToLocationName.containsKey(nodeName)) {
34 mapHNodeNameToLocationName.put(nodeName, nodeName);
36 return mapHNodeNameToLocationName.get(nodeName);
39 public Map<String, String> getMapHNodeNameToLocationName() {
40 return mapHNodeNameToLocationName;