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