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.visualdebugger;
09:
10: import de.uka.ilkd.key.java.SourceElement;
11:
12: /**
13: * A breakpoint is attached to exact one occurrence of a {@link SourceElement}
14: * in the source code. Breakpoints are either <em>enabled</em> or
15: * <em>disabled</em>.
16: */
17: public class Breakpoint {
18:
19: /**
20: * enables or disables the breakpoint
21: */
22: private boolean enabled = true;
23:
24: /**
25: * source code element to which the breakpoint is attached
26: */
27: private final SourceElementId id;
28:
29: /**
30: * creates a breakpoint attached to the specified source element
31: *
32: * @param id
33: * the SourceElementId identifying uniquely an occurrence of
34: * a SourceElement in the code
35: */
36: public Breakpoint(SourceElementId id) {
37: this .id = id;
38: }
39:
40: /**
41: * the occurrence of the source element in the code to which the breakpoint
42: * is attached
43: *
44: * @return the {@link SourceElementId} referring to an occurrence of a
45: * source code element
46: */
47: public SourceElementId getId() {
48: return id;
49: }
50:
51: /**
52: * true iff. the breakpoint is enabled
53: *
54: * @return true iff. the breakpoint is enabled
55: */
56: public boolean isEnabled() {
57: return enabled;
58:
59: }
60:
61: /**
62: * enables or disables the breakpoint
63: *
64: * @param enabled
65: * boolean indicating if the breakpoint has to be enabled or
66: * disabled
67: */
68: public void setEnabled(boolean enabled) {
69: this .enabled = enabled;
70: }
71:
72: /**
73: * toString
74: */
75: public String toString() {
76: return "Statement BP at " + id;
77: }
78: }
|