KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > event > ModificationWatchpointEventImpl


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal.event;
12
13
14 import java.io.DataInputStream JavaDoc;
15 import java.io.IOException JavaDoc;
16
17 import org.eclipse.jdi.internal.MirrorImpl;
18 import org.eclipse.jdi.internal.ValueImpl;
19 import org.eclipse.jdi.internal.VirtualMachineImpl;
20 import org.eclipse.jdi.internal.request.RequestID;
21
22 import com.sun.jdi.Value;
23 import com.sun.jdi.event.ModificationWatchpointEvent;
24
25 /**
26  * this class implements the corresponding interfaces
27  * declared by the JDI specification. See the com.sun.jdi package
28  * for more information.
29  *
30  */

31 public class ModificationWatchpointEventImpl extends WatchpointEventImpl implements ModificationWatchpointEvent {
32     /** Jdwp Event Kind. */
33     public static final byte EVENT_KIND = EVENT_FIELD_MODIFICATION;
34
35     /** Value to be assigned. */
36     private ValueImpl fValueToBe;
37     
38     /**
39      * Creates new ModificationWatchpointEventImpl.
40      */

41     private ModificationWatchpointEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
42         super("ModificationWatchpointEvent", vmImpl, requestID); //$NON-NLS-1$
43
}
44
45     /**
46      * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
47      */

48     public static WatchpointEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream JavaDoc dataInStream) throws IOException JavaDoc {
49         VirtualMachineImpl vmImpl = target.virtualMachineImpl();
50         ModificationWatchpointEventImpl event = new ModificationWatchpointEventImpl(vmImpl, requestID);
51         event.readWatchpointEventFields(target, dataInStream);
52         event.fValueToBe = ValueImpl.readWithTag(target, dataInStream);
53         return event;
54     }
55     
56     /**
57      * @return Returns value that will be assigned to the field when the instruction completes.
58      */

59     public Value valueToBe() {
60         return fValueToBe;
61     }
62 }
63
Popular Tags