01: /*
02: * @(#)CommandEvent.java 1.2 04/12/06
03: *
04: * Copyright (c) 1997-2003 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package pnuts.tools;
10:
11: import pnuts.lang.Context;
12: import java.util.EventObject;
13:
14: /**
15: * Event object which is created by DebugContext to communicate with a debugger.
16: */
17: public class CommandEvent extends EventObject {
18:
19: private Object arg;
20: private int eventType;
21:
22: /**
23: * The event type which indicates line number has been changed.
24: */
25: public final static int LINE_UPDATED = 0;
26:
27: /**
28: * The event type which indicates some exception has been thrown.
29: */
30: public final static int EXCEPTION = 1;
31:
32: /**
33: * The event type which indicates the execution was normally terminated.
34: */
35: public final static int EXITED = 2;
36:
37: /**
38: * The event type which indicates a function is called.
39: */
40: public final static int OPEN_FRAME = 3;
41:
42: /**
43: * The event type which indicates a function returned.
44: */
45: public final static int CLOSE_FRAME = 4;
46:
47: /**
48: * Constructor
49: *
50: * @param context The context which creates the Command Event object.
51: * @param eventType The event type.
52: * @param arg Optional argument.
53: */
54: public CommandEvent(Context context, int eventType, Object arg) {
55: super (context);
56: this .arg = arg;
57: this .eventType = eventType;
58: }
59:
60: /**
61: * Get the event type
62: */
63: public int getType() {
64: return eventType;
65: }
66:
67: /**
68: * Get the optional argument
69: */
70: public Object getArg() {
71: return arg;
72: }
73: }
|