edu.rice.cs.drjava.model.debug
Class DebugAction

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.debug.DebugAction
Direct Known Subclasses:
DocumentDebugAction, Step

public abstract class DebugAction
extends Object

Keeps track of information about any request to the debugger, such as Breakpoints.

Version:
$Id: DebugAction.java,v 1.7 2002/08/23 15:52:33 csreis Exp $

Field Summary
protected  int _countFilter
           
protected  boolean _enabled
           
protected  int _lineNumber
           
protected  DebugManager _manager
           
protected  gj.util.Vector _requests
          Vector of EventRequests.
protected  int _suspendPolicy
           
static int ANY_LINE
           
 
Constructor Summary
DebugAction(DebugManager manager)
          Creates a new DebugAction.
 
Method Summary
protected  void _createRequests()
          Creates an appropriate EventRequest from the EventRequestManager and stores it in the _request field.
protected  void _initializeRequests()
          This should always be called from the constructor of the subclass.
protected  void _prepareRequest(com.sun.jdi.request.EventRequest request)
          Prepares this EventRequest with the current stored values.
protected  void _prepareRequests(gj.util.Vector requests)
          Prepares all relevant EventRequests with the current stored values.
 boolean createRequests()
          Creates an EventRequest corresponding to this DebugAction, using the given ReferenceType.
 int getLineNumber()
          Returns the line number this DebugAction occurs on
 gj.util.Vector getRequests()
          Returns the EventRequest corresponding to this DebugAction, if it has been created, null otherwise.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ANY_LINE

public static final int ANY_LINE

_manager

protected DebugManager _manager

_requests

protected gj.util.Vector _requests
Vector of EventRequests. There might be more than one, since there can be multiple reference types for one class. They all share the same attributes, though, so the other fields don't need to be vectors.

_suspendPolicy

protected int _suspendPolicy

_enabled

protected boolean _enabled

_countFilter

protected int _countFilter

_lineNumber

protected int _lineNumber
Constructor Detail

DebugAction

public DebugAction(DebugManager manager)
            throws DebugException,
                   IllegalStateException
Creates a new DebugAction. Automatically tries to create the EventRequest if a ReferenceType can be found, or else adds this object to the PendingRequestManager. Any subclass should automatically call _initializeRequest in its constructor.
Parameters:
manager - DebugManager in charge
doc - Document this action corresponds to
Method Detail

getRequests

public gj.util.Vector getRequests()
Returns the EventRequest corresponding to this DebugAction, if it has been created, null otherwise.

getLineNumber

public int getLineNumber()
Returns the line number this DebugAction occurs on

createRequests

public boolean createRequests()
                       throws DebugException
Creates an EventRequest corresponding to this DebugAction, using the given ReferenceType. This is called either from the DebugAction constructor or the PendingRequestManager, depending on when the ReferenceType becomes available. This DebugAction must be an instance of DocumentDebugAction since a ReferenceType is being used.
Returns:
true if the EventRequest is successfully created

_initializeRequests

protected void _initializeRequests()
                            throws DebugException
This should always be called from the constructor of the subclass. Tries to create all applicable EventRequests for this DebugAction.

_createRequests

protected void _createRequests()
                        throws DebugException
Creates an appropriate EventRequest from the EventRequestManager and stores it in the _request field.
Parameters:
rt - ReferenceType used to try to create the request
Throws:
DebugException - if the request could not be created.

_prepareRequests

protected void _prepareRequests(gj.util.Vector requests)
Prepares all relevant EventRequests with the current stored values.
Parameters:
requests - the EventRequests to prepare

_prepareRequest

protected void _prepareRequest(com.sun.jdi.request.EventRequest request)
Prepares this EventRequest with the current stored values.
Parameters:
request - the EventRequest to prepare