2 * @author Richard Gradischnegg
3 * Created on Oct 31, 2003
5 package isac.util.formulae;
6 import isac.bridge.xml.DataTypes; //.scala
8 import edu.tum.cs.isabelle.api.XML; //.scala
10 import java.io.Serializable;
13 * @author Richard Gradischnegg
16 public class Specification implements Serializable {
18 static final long serialVersionUID = 5531717778036867586L;
20 protected CalcHeadSimpleID theory_;
22 protected HierarchyKey problem_, method_;
24 public Specification(){}
25 public Specification(CalcHeadSimpleID thy, HierarchyKey pbl, HierarchyKey met){
31 public String toSMLString() {
32 StringBuffer sb = new StringBuffer();
33 sb.append(getTheory().getQuotedID());
35 sb.append(getProblem().toSMLString());
37 sb.append(getMethod().toSMLString());
41 public CalcHeadSimpleID getTheory() {
45 public HierarchyKey getMethod() {
49 public HierarchyKey getProblem() {
50 return problem_;//(ProblemID)problem_ ---> ClassCastException ?
53 public void setTheory(CalcHeadSimpleID el) {
57 public void setProblem(HierarchyKey el) {
61 public void setMethod(HierarchyKey el) {
65 //WN0505 this stems from a misunderstanding in 03!
66 public String toString() {
67 String content = "<SPECIFICATION>\n";
68 if (theory_ != null) {
69 content += "<THEORY>\n" + theory_ + "</THEORY>\n";
72 content += "<PROBLEM>\n" + problem_ + "</PROBLEM>\n";
73 if (method_ != null) content += "<METHOD>\n" + method_ + "</METHOD>\n";
74 content += "</SPECIFICATION>\n";
77 // conversion is done in Scala, because it is much simpler there
78 public XML.Tree toXML() {
79 return DataTypes.xml_of_Specification(this);