package edu.uci.eecs.specCompiler.specExtraction;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+
public class InterfaceConstruct extends Construct {
+ public final String name;
+ public final ArrayList<String> commitPointSet;
+ public final String condition;
+ public final HashMap<String, String> hbConditions;
+ public final String idCode;
+ public final String check;
+ public final ArrayList<String> action;
+ public final ArrayList<String> postAction;
+ public final String postCheck;
+
+ public InterfaceConstruct(File file, int beginLineNum, String name,
+ ArrayList<String> commitPointSet, String condition,
+ HashMap<String, String> hbConditions, String idCode, String check,
+ ArrayList<String> action, ArrayList<String> postAction, String postCheck) {
+ super(file, beginLineNum);
+ this.name = name;
+ this.commitPointSet = commitPointSet;
+ this.condition = condition;
+ this.hbConditions = hbConditions;
+ this.idCode = idCode;
+ this.check = check;
+ this.action = action;
+ this.postAction = postAction;
+ this.postCheck = postCheck;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder("InterfaceConstruct:\n");
+ sb.append("@Interface: " + name + "\n");
+ sb.append("@Commit_point_set: ");
+ for (String commitPoint : commitPointSet) {
+ sb.append(commitPoint + " | ");
+ }
+ sb.append(".\n");
+ sb.append("@Condition: ");
+ sb.append(condition + "\n");
+ sb.append("@HBConditions: \n");
+ for (String hbLabel : hbConditions.keySet()) {
+ String hbCondition = hbConditions.get(hbLabel);
+ sb.append(hbLabel + " :: " + hbCondition + "\n");
+ }
+ sb.append("@ID: ");
+ sb.append(idCode + "\n");
+ sb.append("@Check: " + check + "\n");
+ sb.append(ParserUtils.array2Str(action));
+ sb.append("@Post_action:\n");
+ sb.append(ParserUtils.array2Str(postAction));
+ sb.append("@Post_check: " + postCheck + "\n");
+ return sb.toString();
+ }
}