edu.rice.cs.drjava.model.debug.jpda
Class JPDABreakpoint

java.lang.Object
  extended by edu.rice.cs.drjava.model.debug.jpda.DebugAction<T>
      extended by edu.rice.cs.drjava.model.debug.jpda.DocumentDebugAction<com.sun.jdi.request.BreakpointRequest>
          extended by edu.rice.cs.drjava.model.debug.jpda.JPDABreakpoint
All Implemented Interfaces:
Breakpoint, DebugBreakpointData, IDocumentRegion, OrderedDocumentRegion, Region, Comparable<OrderedDocumentRegion>

public class JPDABreakpoint
extends DocumentDebugAction<com.sun.jdi.request.BreakpointRequest>
implements Breakpoint

The breakpoint object which has references to its OpenDefinitionsDocument and its BreakpointRequest. See the WARNING below about hashing on this type or its subtypes.


Field Summary
private  OpenDefinitionsDocument _doc
          Note that _position, which records the breakpoint position, is inherited from DocumentDebugAction.
private  Position _endPos
           
private  Position _position
           
private  Position _startPos
           
 
Fields inherited from class edu.rice.cs.drjava.model.debug.jpda.DocumentDebugAction
_className, _exactClassName, _file, _offset, SHORT_DOC_MAX_LENGTH
 
Fields inherited from class edu.rice.cs.drjava.model.debug.jpda.DebugAction
_countFilter, _isEnabled, _lineNumber, _manager, _requests, _suspendPolicy, ANY_LINE
 
Constructor Summary
JPDABreakpoint(OpenDefinitionsDocument doc, int offset, boolean isEnabled, JPDADebugger manager)
           
 
Method Summary
protected  void _createRequests(Vector<com.sun.jdi.ReferenceType> refTypes)
          Creates appropriate EventRequests from the EventRequestManager and stores them in the _requests field.
 int compareTo(OrderedDocumentRegion r)
          Totally orders regions lexicographically based on (_doc, endOffset, startOffset).
 boolean equals(Object o)
          Defines the equality relation on DocumentRegions.
 int getEndOffset()
          Accessor for the offset of this breakpoint's end position
 int getLineEndOffset()
          Accessor for the offset of this breakpoint's end position
 int getLineNumber()
          Returns the line number this DebugAction occurs on
 int getLineStartOffset()
          Accessor for the offset of this breakpoint's start position
 int getStartOffset()
          Accessor for the offset of this breakpoint's start position
 String getString()
          Returns the String used on the JTree label for this breakpoint.
 boolean isEmpty()
           
 void setEnabled(boolean isEnabled)
          Enable/disable the breakpoint.
 String toString()
           
 void update()
          Update _startPos, _endPos and _lineNumber from the position that moves with the document.
 
Methods inherited from class edu.rice.cs.drjava.model.debug.jpda.DocumentDebugAction
_initializeRequests, _prepareRequest, createRequests, getClassName, getDocument, getExactClassName, getFile, getOffset
 
Methods inherited from class edu.rice.cs.drjava.model.debug.jpda.DebugAction
_createRequests, _initializeRequests, _prepareRequests, createRequests, getRequests, isEnabled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.rice.cs.drjava.model.debug.Breakpoint
getClassName
 
Methods inherited from interface edu.rice.cs.drjava.model.debug.DebugBreakpointData
getFile, isEnabled
 
Methods inherited from interface edu.rice.cs.drjava.model.IDocumentRegion
getDocument
 

Field Detail

_position

private volatile Position _position

_startPos

private volatile Position _startPos

_endPos

private volatile Position _endPos

_doc

private volatile OpenDefinitionsDocument _doc
Note that _position, which records the breakpoint position, is inherited from DocumentDebugAction.

Constructor Detail

JPDABreakpoint

public JPDABreakpoint(OpenDefinitionsDocument doc,
                      int offset,
                      boolean isEnabled,
                      JPDADebugger manager)
               throws DebugException
Throws:
DebugException - if the document does not have a file
Method Detail

getString

public String getString()
Returns the String used on the JTree label for this breakpoint.

Specified by:
getString in interface OrderedDocumentRegion

_createRequests

protected void _createRequests(Vector<com.sun.jdi.ReferenceType> refTypes)
                        throws DebugException
Creates appropriate EventRequests from the EventRequestManager and stores them in the _requests field.

Specified by:
_createRequests in class DocumentDebugAction<com.sun.jdi.request.BreakpointRequest>
Parameters:
refTypes - All (identical) ReferenceTypes to which this action applies. (There may be multiples if a custom class loader is in use.)
Throws:
DebugException - if the requests could not be created.

getStartOffset

public int getStartOffset()
Accessor for the offset of this breakpoint's start position

Specified by:
getStartOffset in interface Region
Returns:
the start offset

getEndOffset

public int getEndOffset()
Accessor for the offset of this breakpoint's end position

Specified by:
getEndOffset in interface Region
Returns:
the end offset

getLineStartOffset

public int getLineStartOffset()
Accessor for the offset of this breakpoint's start position

Specified by:
getLineStartOffset in interface OrderedDocumentRegion
Returns:
the start offset

getLineEndOffset

public int getLineEndOffset()
Accessor for the offset of this breakpoint's end position

Specified by:
getLineEndOffset in interface OrderedDocumentRegion
Returns:
the end offset

update

public void update()
Update _startPos, _endPos and _lineNumber from the position that moves with the document.

Specified by:
update in interface Breakpoint
Specified by:
update in interface OrderedDocumentRegion

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface OrderedDocumentRegion

equals

public final boolean equals(Object o)
Defines the equality relation on DocumentRegions. This equivalence relation on allocated objects is finer grained than the equivalence relation induced by compareTo because it requires equality on Position objects, not just equality of the current offsets of Positions.

Overrides:
equals in class Object

compareTo

public int compareTo(OrderedDocumentRegion r)
Totally orders regions lexicographically based on (_doc, endOffset, startOffset). This method is typically applied to regions within the same document.

Specified by:
compareTo in interface Comparable<OrderedDocumentRegion>

getLineNumber

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

Specified by:
getLineNumber in interface DebugBreakpointData
Overrides:
getLineNumber in class DebugAction<com.sun.jdi.request.BreakpointRequest>
Returns:
line number of the breakpoint.

setEnabled

public void setEnabled(boolean isEnabled)
Enable/disable the breakpoint.

Specified by:
setEnabled in interface Breakpoint
Overrides:
setEnabled in class DebugAction<com.sun.jdi.request.BreakpointRequest>

toString

public String toString()
Overrides:
toString in class Object