Class SymbolTableTreeNode

  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.jstatcom.model.control.SymbolTableTreeNode
All Implemented Interfaces:, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public final class SymbolTableTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

Treenode to be used with SymbolTree for displaying SymbolTable objects a JTree.

Markus Kraetzig
See Also:
Serialized Form

Field Summary
 SymbolTable symbolTable
          SymbolTable represented by this tree node.
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
Constructor Summary
SymbolTableTreeNode(SymbolTable symbolTable, javax.swing.tree.DefaultTreeModel symbolTreeModel)
          Creates a tree node for a symbol.
Method Summary
 void addSymbol(Symbol symbol)
          Adds a symbol to this node.
 void clear()
          Removes all children that are SymbolTreeNode instances from this node.
 void removeSymbol(java.lang.String name)
          Removes a symbol node with name from this table node.
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, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public final SymbolTable symbolTable
SymbolTable represented by this tree node.

Constructor Detail


public SymbolTableTreeNode(SymbolTable symbolTable,
                           javax.swing.tree.DefaultTreeModel symbolTreeModel)
Creates a tree node for a symbol.

symbolTable - the respective table
symbolTreeModel - the used tree model
java.lang.IllegalArgumentException - if (symbolTable == null)
Method Detail


public void addSymbol(Symbol symbol)
Adds a symbol to this node. It keeps the alphabetic order of the nodes. Symbols are always added after symbol tables.

symbol - to be put in tree


public void removeSymbol(java.lang.String name)
Removes a symbol node with name from this table node.

name - the identifier of the symbol to remove


public void clear()
Removes all children that are SymbolTreeNode instances from this node. It removes itself from the parent node if (getChildCount() == 0) afterwards. It might still be that SymbolTableTreeNode instances are contained in this node.