com.bluemarsh.jswat.panel
Class ObjectDbgVar

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

public class ObjectDbgVar
extends DbgVar

Class ObjectDbgVar represents an ObjectReference variable.

Author:
David Lum, Nathan Fiedler
See Also:
Serialized Form

Field Summary
protected static javax.swing.ImageIcon icon
          Our object icon.
protected  com.sun.jdi.ObjectReference objRef
          Object reference 'this' represents.
protected  java.util.Map valuesMap
          This will eventually be set to the map of values for it.
 
Fields inherited from class com.bluemarsh.jswat.panel.DbgVar
typeName, varName
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
protected ObjectDbgVar(java.lang.String name, java.lang.String type, com.sun.jdi.ObjectReference val)
          Creates a new ObjectDbgVar from a name, type, and value.
 
Method Summary
 java.util.Enumeration children()
          Redefined from parent to whip up a child list "just in time."
protected  void concoctChildren()
          Adds children from 'this' object's fields.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
protected  boolean formsLoop(com.sun.jdi.ObjectReference objref)
          Test if the given object reference already exists in the parent heirarchy.
 javax.swing.tree.TreeNode getChildAt(int index)
          Redefined from parent to whip up a child list "just in time."
 int getChildCount()
          Redefined from parent to allow 'this' variable's fields to appear as child nodes.
 javax.swing.Icon getIcon(boolean isExpanded)
          Redefined to return a suitable "object" icon.
 com.sun.jdi.Value getValue()
          Retrieve the value this variable represents.
protected  java.util.Map getValuesMap()
          Returns the values Map for 'this' (creates it if necessary).
 void refresh()
          Refreshes the variable.
 java.lang.String toString()
          Returns a string description of 'this' variable.
 
Methods inherited from class com.bluemarsh.jswat.panel.DbgVar
compareTo, create, create, create, createLoop
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildBefore, 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
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

icon

protected static javax.swing.ImageIcon icon
Our object icon.

objRef

protected com.sun.jdi.ObjectReference objRef
Object reference 'this' represents.

valuesMap

protected java.util.Map valuesMap
This will eventually be set to the map of values for it. It should always be accessed via the getValuesMap() method.
Constructor Detail

ObjectDbgVar

protected ObjectDbgVar(java.lang.String name,
                       java.lang.String type,
                       com.sun.jdi.ObjectReference val)
Creates a new ObjectDbgVar from a name, type, and value.
Parameters:
name - the name of the variable.
type - the type of the variable.
val - the value of the variable.
Method Detail

children

public java.util.Enumeration children()
Redefined from parent to whip up a child list "just in time."
Overrides:
children in class javax.swing.tree.DefaultMutableTreeNode

concoctChildren

protected void concoctChildren()
Adds children from 'this' object's fields.

formsLoop

protected boolean formsLoop(com.sun.jdi.ObjectReference objref)
Test if the given object reference already exists in the parent heirarchy.
Parameters:
objref - object reference to test.
Returns:
true if 'objref' links to this or a parent var.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

getChildAt

public javax.swing.tree.TreeNode getChildAt(int index)
Redefined from parent to whip up a child list "just in time."
Overrides:
getChildAt in class javax.swing.tree.DefaultMutableTreeNode
Parameters:
index - index of child.
Returns:
Child node.

getChildCount

public int getChildCount()
Redefined from parent to allow 'this' variable's fields to appear as child nodes.
Overrides:
getChildCount in class javax.swing.tree.DefaultMutableTreeNode
Returns:
the number of fields in 'this' object reference variable.

getIcon

public javax.swing.Icon getIcon(boolean isExpanded)
Redefined to return a suitable "object" icon.
Overrides:
getIcon in class BasicTreeNode
Parameters:
isExpanded - true if tree node is expanded.
Returns:
Icon of the tree node.

getValue

public com.sun.jdi.Value getValue()
Retrieve the value this variable represents.
Overrides:
getValue in class DbgVar
Returns:
Value.

getValuesMap

protected java.util.Map getValuesMap()
Returns the values Map for 'this' (creates it if necessary). Any static final fields will be ignored, as they are constant and not interesting.
Returns:
a Map with the fields and values for 'this' (object) variable.

refresh

public void refresh()
Refreshes the variable.
Overrides:
refresh in class DbgVar

toString

public java.lang.String toString()
Returns a string description of 'this' variable.
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
a description of 'this' variable.