com.bluemarsh.jswat.panel
Class DbgVar

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--com.bluemarsh.jswat.panel.BasicTreeNode
              |
              +--com.bluemarsh.jswat.panel.DbgVar
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode
Direct Known Subclasses:
ObjectDbgVar

public abstract class DbgVar
extends BasicTreeNode
implements java.lang.Comparable

A DbgVar is an abstract class that represents a debugger variable.

Author:
David Lum
See Also:
ObjectDbgVar, Serialized Form

Field Summary
protected  java.lang.String typeName
          Type of 'this' variable, e.g.
protected  java.lang.String varName
          Name of 'this' variable, e.g.
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
protected DbgVar(java.lang.String name, java.lang.String type)
          Creates a new DbgVar from a name and type.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
static DbgVar create(com.sun.jdi.Field field, com.sun.jdi.Value val)
          Creates a new DbgVar from a Field and a Value.
static DbgVar create(com.sun.jdi.LocalVariable var, com.sun.jdi.Value val)
          Creates a new DbgVar from a local variable and value.
static DbgVar create(java.lang.String name, java.lang.String type, com.sun.jdi.Value val)
          Creates a new DbgVar based on name, type name, and value.
static DbgVar createLoop(com.sun.jdi.Field field, com.sun.jdi.ObjectReference val)
          Creates a DbgVar that, directly or indirectly, refers to itself.
abstract  com.sun.jdi.Value getValue()
          Retrieve the value this variable represents.
abstract  void refresh()
          Refreshes the variable.
 
Methods inherited from class com.bluemarsh.jswat.panel.BasicTreeNode
getIcon
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

varName

protected java.lang.String varName
Name of 'this' variable, e.g. "foo".

typeName

protected java.lang.String typeName
Type of 'this' variable, e.g. "int".
Constructor Detail

DbgVar

protected DbgVar(java.lang.String name,
                 java.lang.String type)
Creates a new DbgVar from a name and type.
Parameters:
name - the name of the variable.
type - the type of the variable.
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.

create

public static DbgVar create(com.sun.jdi.LocalVariable var,
                            com.sun.jdi.Value val)
Creates a new DbgVar from a local variable and value.
Parameters:
var - the local variable.
val - value of var.
Returns:
a new DbgVar.

create

public static DbgVar create(com.sun.jdi.Field field,
                            com.sun.jdi.Value val)
Creates a new DbgVar from a Field and a Value.
Parameters:
field - the field.
val - value of field.
Returns:
a new DbgVar.

createLoop

public static DbgVar createLoop(com.sun.jdi.Field field,
                                com.sun.jdi.ObjectReference val)
Creates a DbgVar that, directly or indirectly, refers to itself.
Parameters:
field - the field.
val - value of field.
Returns:
the newly created DbgVar.

create

public static DbgVar create(java.lang.String name,
                            java.lang.String type,
                            com.sun.jdi.Value val)
Creates a new DbgVar based on name, type name, and value.
Parameters:
name - name of the variable.
type - type of the variable.
val - value of the variable.
Returns:
a new DbgVar.

getValue

public abstract com.sun.jdi.Value getValue()
Retrieve the value this variable represents.
Returns:
Value.

refresh

public abstract void refresh()
Refreshes the variable.