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

java.lang.Object
  extended by edu.rice.cs.drjava.model.debug.DebugWatchData

public class DebugWatchData
extends Object

Class for keeping track of watched fields and variables.

Version:
$Id: DebugWatchData.java 4482 2008-05-18 22:05:59Z rcartwright $

Field Summary
static String NO_TYPE
          String to display if the type is not in scope.
static String NO_VALUE
          String to display if the value is not in scope.
static String NOT_LOADED
          String to display if the type is not loaded.
 
Constructor Summary
DebugWatchData(String name)
          Object to keep track of a watched field or variable.
 
Method Summary
 String getName()
          Returns the name of this field or variable.
 String getType()
          Returns the type of this field or variable in the current context.
 String getValue()
          Returns the most recently determined value for this field or variable.
 void hideValueAndType()
          Hides the value for this watch (when no thread is suspended).
 boolean isChanged()
          Returns whether this value has changed since the last call to setValue.
 void setName(String name)
          Sets a new name for this field or variable.
 void setNoType()
          Called to indicate that this watch has no type in the current scope.
 void setNoValue()
          Called to indicate that this watch has no value in the current scope.
 void setType(String type)
          Sets the most recently determined type of this field or variable.
 void setTypeNotLoaded()
          Called to indicate that this watch's type has not been loaded.
 void setValue(Object value)
          Sets the most recently determined value for this field or variable.
 String toString()
          Returns a legible representation of the type, name, and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_VALUE

public static final String NO_VALUE
String to display if the value is not in scope.

See Also:
Constant Field Values

NO_TYPE

public static final String NO_TYPE
String to display if the type is not in scope.

See Also:
Constant Field Values

NOT_LOADED

public static final String NOT_LOADED
String to display if the type is not loaded.

See Also:
Constant Field Values
Constructor Detail

DebugWatchData

public DebugWatchData(String name)
Object to keep track of a watched field or variable.

Parameters:
name - Name of the field or variable to watch
Method Detail

getName

public String getName()
Returns the name of this field or variable.


getValue

public String getValue()
Returns the most recently determined value for this field or variable.


getType

public String getType()
Returns the type of this field or variable in the current context.


setName

public void setName(String name)
Sets a new name for this field or variable.

Parameters:
name - Name of the field or variable

setValue

public void setValue(Object value)
Sets the most recently determined value for this field or variable.

Parameters:
value - Value of the field or variable

hideValueAndType

public void hideValueAndType()
Hides the value for this watch (when no thread is suspended).


setNoValue

public void setNoValue()
Called to indicate that this watch has no value in the current scope.


setType

public void setType(String type)
Sets the most recently determined type of this field or variable.

Parameters:
type - Type of the field or variable

setNoType

public void setNoType()
Called to indicate that this watch has no type in the current scope.


setTypeNotLoaded

public void setTypeNotLoaded()
Called to indicate that this watch's type has not been loaded.


isChanged

public boolean isChanged()
Returns whether this value has changed since the last call to setValue.


toString

public String toString()
Returns a legible representation of the type, name, and value.

Overrides:
toString in class Object