parsing passed
[cdsspec-compiler.git] / src / edu / uci / eecs / specCompiler / specExtraction / InterfaceConstruct.java
1 package edu.uci.eecs.specCompiler.specExtraction;
2
3 import java.util.ArrayList;
4 import java.util.HashMap;
5
6 public class InterfaceConstruct extends Construct {
7         public final String name;
8         public final ArrayList<String> commitPointSet;
9         public final String condition;
10         public final HashMap<String, String> hbConditions;
11         public final String idCode;
12         public final String check;
13         public final String action;
14         public final String postAction;
15         public final String postCheck;
16
17         public InterfaceConstruct(String name, ArrayList<String> commitPointSet,
18                         String condition, HashMap<String, String> hbConditions, String idCode,
19                         String check, String action, String postAction, String postCheck) {
20                 this.name = name;
21                 this.commitPointSet = commitPointSet;
22                 this.condition = condition;
23                 this.hbConditions = hbConditions;
24                 this.idCode = idCode;
25                 this.check = check;
26                 this.action = action;
27                 this.postAction = postAction;
28                 this.postCheck = postCheck;
29         }
30         
31         public String toString() {
32                 StringBuilder sb = new StringBuilder("InterfaceConstruct:\n");
33                 sb.append("@Interface: " + name + "\n");
34                 sb.append("@Commit_point_set: ");
35                 for (String commitPoint : commitPointSet) {
36                         sb.append(commitPoint + " | ");
37                 }
38                 sb.append(".\n");
39                 sb.append("@Condition: ");
40                 sb.append(condition + "\n");
41                 sb.append("@HBConditions: \n");
42                 for (String hbLabel : hbConditions.keySet()) {
43                         String hbCondition = hbConditions.get(hbLabel);
44                         sb.append(hbLabel + " :: " + hbCondition + "\n");
45                 }
46                 sb.append("@ID: ");
47                 sb.append(idCode + "\n");
48                 sb.append("@Check: " + check + "\n");
49                 sb.append("@Action:\n");
50                 sb.append(action + "\n");
51                 sb.append("@Post_action:\n");
52                 sb.append(postAction + "\n");
53                 sb.append("@Post_check: " + postCheck + "\n");
54                 
55                 return sb.toString();
56         }
57 }