1 /*
2 * $Id: JdiEvent.java,v 1.1 2003/04/02 19:48:55 austvold Exp $
3 * Copyright 2003 OErjan Nygaard Austvold. All rights reserved.
4 */
5
6 package org.jdiseq;
7
8 import com.sun.jdi.Method;
9 import com.sun.jdi.ThreadReference;
10 import com.sun.jdi.ObjectReference;
11 import com.sun.jdi.ReferenceType;
12
13 /***
14 * This class implements state about a JDI event that occured.
15 * <p>Changelog:
16 * <pre>
17 * $Log: JdiEvent.java,v $
18 * Revision 1.1 2003/04/02 19:48:55 austvold
19 * Minor updates. Mostly adaptation to new event and eventlistener name.
20 * General brush-up on javadoc comments.
21 * Removal of auto-added revision and date-of-commit members.
22 *
23 * Revision 1.1.1.1 2003/03/28 08:18:23 austvold
24 * Initial import.
25 *
26 * </pre>
27 *
28 * @author Ørjan Nygaard Austvold <austvold@acm.org>
29 * @version $Id: JdiEvent.java,v 1.1 2003/04/02 19:48:55 austvold Exp $
30 */
31 public class JdiEvent {
32 private boolean methodEntry; // true if method entry, false otherwise
33 private Method method;
34 private ThreadReference threadReference;
35 private ObjectReference objectReference;
36 private ReferenceType declaringType;
37
38 /***
39 * Constructs a new JDI event. The events state can be queried later
40 * by various getters.
41 * @param methodEntry true if this is a method entry, false otherwise.
42 * @param method the method that the event occured on.
43 * @param threadReference a reference to the thread that generated the event.
44 * @param objectReference a reference to the object in/on which the
45 * thread was executing while the event occured.
46 * @param declaringType the type of the object reference.
47 */
48 public JdiEvent(boolean methodEntry, Method method, ThreadReference threadReference, ObjectReference objectReference, ReferenceType declaringType) {
49 this.methodEntry = methodEntry;
50 this.method = method;
51 this.threadReference = threadReference;
52 this.objectReference = objectReference;
53 this.declaringType = declaringType;
54 }
55
56
57 /***
58 * Determines if this event was a method entry.
59 * @return true if this event describes a method entry, false otherwise.
60 */
61 public boolean isMethodEntry() {
62 return methodEntry;
63 }
64
65 /***
66 * Gets the method that the event occured on.
67 * @return a JDI method reference.
68 */
69 public Method getMethod() {
70 return method;
71 }
72
73
74 /***
75 * Gets the thread that were executing on/in the method when the event occured.
76 * @return a JDI thread reference.
77 */
78 public ThreadReference getThreadReference() {
79 return threadReference;
80 }
81
82
83 /***
84 * Gets the object in/on which a thread was executing when the event occured.
85 * @return a JDI object reference.
86 */
87 public ObjectReference getObjectReference() {
88 return objectReference;
89 }
90
91
92 /***
93 * Gets the type in which the method event occured in.
94 * @return a JDI type reference.
95 */
96 public ReferenceType getDeclaringType() {
97 return declaringType;
98 }
99 }
This page was automatically generated by Maven