UniVista.support
Class GroupNode

java.lang.Object
  |
  +--UniVista.support.GroupNode
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class GroupNode
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

a GroupNode is a node for a hierarchial tree structure to hold groupings of strings. The string objects that are held are intended to be keys from hashtables

See Also:
Serialized Form

Constructor Summary
GroupNode()
           
 
Method Summary
 void addChild(GroupNode newChild)
          add a child group node or leaf to the node
 java.lang.Object clone()
          clone the GroupNode
 javax.swing.tree.DefaultMutableTreeNode convertForJTree()
           
 javax.swing.tree.DefaultMutableTreeNode convertForJTreeCopy()
          convert a GroupNode tree structure to a JTree structure
 javax.swing.tree.DefaultMutableTreeNode convertGroupsForJTree()
          convert only the groups of a tree structure to a JTree structure
 boolean equals(java.lang.Object obj)
          compare two GroupNodes for equality.
 void forceToGroup()
          force a GroupNode to be a group...allows for empty groups
 GroupNode[] getChildren()
          extract the array of children
 java.lang.String getDescription()
          returns the description of the node
 GroupNode getLeafForString(java.lang.String searchFor)
          return the group node that contains the given leaf object
 GroupNode getParent()
          returns the parent GroupNode in the tree structure
 java.lang.String getString()
          retrieve the String object
 boolean isGroup()
          returns whether the node is a group or not
 boolean isLeaf()
          returns whether the node is a leaf in the structure
 boolean isVariable()
          returns whether the node is a variable
 void removeChild(GroupNode toRemove)
          remove a child from the node
 void setDescription(java.lang.String descr)
          sets the description of the node
 void setString(java.lang.String theVar)
          set the String object for a leaf
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupNode

public GroupNode()
Method Detail

addChild

public void addChild(GroupNode newChild)
add a child group node or leaf to the node

clone

public java.lang.Object clone()
clone the GroupNode
Overrides:
clone in class java.lang.Object

convertForJTreeCopy

public javax.swing.tree.DefaultMutableTreeNode convertForJTreeCopy()
convert a GroupNode tree structure to a JTree structure

convertForJTree

public javax.swing.tree.DefaultMutableTreeNode convertForJTree()

convertGroupsForJTree

public javax.swing.tree.DefaultMutableTreeNode convertGroupsForJTree()
convert only the groups of a tree structure to a JTree structure

equals

public boolean equals(java.lang.Object obj)
compare two GroupNodes for equality. Ordering of children does matter.
Overrides:
equals in class java.lang.Object

forceToGroup

public void forceToGroup()
force a GroupNode to be a group...allows for empty groups

getChildren

public GroupNode[] getChildren()
extract the array of children

getDescription

public java.lang.String getDescription()
returns the description of the node

getLeafForString

public GroupNode getLeafForString(java.lang.String searchFor)
return the group node that contains the given leaf object

getParent

public GroupNode getParent()
returns the parent GroupNode in the tree structure

getString

public java.lang.String getString()
retrieve the String object

isGroup

public boolean isGroup()
returns whether the node is a group or not

isLeaf

public boolean isLeaf()
returns whether the node is a leaf in the structure

isVariable

public boolean isVariable()
returns whether the node is a variable

removeChild

public void removeChild(GroupNode toRemove)
remove a child from the node

setDescription

public void setDescription(java.lang.String descr)
sets the description of the node

setString

public void setString(java.lang.String theVar)
set the String object for a leaf

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object