01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: package de.uka.ilkd.key.visualization;
09:
10: import de.uka.ilkd.key.java.SourceElement;
11: import de.uka.ilkd.key.java.reference.IExecutionContext;
12: import de.uka.ilkd.key.proof.Node;
13:
14: public class ContextTraceElement extends TraceElement {
15:
16: private ParentContextTraceElement parent;
17: protected int noe = -1;
18: protected String label;
19: protected SourceElement contextStatement = null;
20:
21: public ContextTraceElement(SourceElement prElement, Node node,
22: TraceElement nip, ContextTraceElement ne) {
23: this (prElement, node, nip, ne, null);
24: }
25:
26: public ContextTraceElement(SourceElement prElement, Node n,
27: TraceElement nip, ContextTraceElement ne,
28: IExecutionContext exCont) {
29: super (prElement, n, nip, ne, exCont);
30: }
31:
32: public ContextTraceElement() {
33: super ();
34: }
35:
36: public void setContextStatement(SourceElement se) {
37: contextStatement = se;
38: }
39:
40: public SourceElement getContextStatement() {
41: return contextStatement;
42: }
43:
44: public void setParent(ParentContextTraceElement he) {
45: parent = he;
46: }
47:
48: public ParentContextTraceElement getParent() {
49: return parent;
50: }
51:
52: public int getNumberOfExecutions() {
53: return noe;
54: }
55:
56: public void setNumberOfExecutions(int noe) {
57: this .noe = noe;
58: }
59:
60: public void setLabel(String s) {
61: label = s;
62: }
63:
64: public String getLabel() {
65: return label;
66: }
67:
68: public String toString() {
69: String s = "ContextTraceElement:\n";
70: if (this == END)
71: return "END";
72: if (this == PARENTROOT)
73: return "PARENTROOT";
74: if (node != null)
75: s = s + (serialNr() + "\n");
76: if (programElement != null)
77: s = s + programElement + "\n"
78: + programElement.getPositionInfo();
79: if (stepInto != null)
80: s = s + "\nNext executed: " + stepInto.serialNr();
81: if (parent != null)
82: s = s + "\nParent: " + parent.serialNr();
83: return s;
84: }
85:
86: }
|