gov.usda.gdpc.gui.dbetree
Class HeadNode

java.lang.Object
  extended bygov.usda.gdpc.gui.dbetree.HeadNode
All Implemented Interfaces:
Node

public class HeadNode
extends java.lang.Object
implements Node

Author:
terryc

Constructor Summary
HeadNode(DBElementTreeModel parent)
          HeadNode Constructor.
HeadNode(java.util.List properties, DBElementTreeModel parent)
          HeadNode Constructor.
 
Method Summary
 boolean add(DBElement element)
          Adds a DBElement to this property node tree.
 void add(java.util.List list)
          Adds a list of DBElements to this property node tree.
 void addNotify(javax.swing.event.TreeModelEvent event)
           
 java.util.Iterator children()
           
 boolean getAllowsChildren()
           
 java.lang.Object getChildAt(int index)
          Returns this node's child at the given index.
 int getChildCount()
          Returns the number of children for this node.
 int getIndexOfChild(java.lang.Object child)
          Gets index of given child.
 int getLeafNodeCount()
          Returns the number of leaf nodes in this tree.
 java.util.List getLeafNodes()
           
 Node getParent()
           
 PropertyNode getPropertyNode()
           
 boolean isLeaf()
           
 boolean remove(DBElement element)
          Removes given element from this node down.
 javax.swing.event.TreeModelEvent remove(ValueNode node)
          Removes given value node from this node down.
 boolean removeAll()
          Removes all DBElements from this node down.
 void removeNotify(javax.swing.event.TreeModelEvent event)
           
 void setParent(DBElementTreeModel parent)
           
 java.lang.String toString()
          Returns string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeadNode

public HeadNode(java.util.List properties,
                DBElementTreeModel parent)
HeadNode Constructor.


HeadNode

public HeadNode(DBElementTreeModel parent)
HeadNode Constructor.

Method Detail

setParent

public void setParent(DBElementTreeModel parent)

add

public boolean add(DBElement element)
Adds a DBElement to this property node tree.

Specified by:
add in interface Node
Parameters:
element - the element to add.
Returns:
true if tree changed because of add.

add

public void add(java.util.List list)
Adds a list of DBElements to this property node tree.

Parameters:
list - the list to add.

remove

public boolean remove(DBElement element)
Removes given element from this node down.

Specified by:
remove in interface Node
Parameters:
element - element to remove
Returns:
true if tree changed because of remove.

remove

public javax.swing.event.TreeModelEvent remove(ValueNode node)
Removes given value node from this node down.

Parameters:
node - node to remove
Returns:
tree model event

removeAll

public boolean removeAll()
Removes all DBElements from this node down.

Specified by:
removeAll in interface Node

getChildAt

public java.lang.Object getChildAt(int index)
                            throws java.lang.IndexOutOfBoundsException
Returns this node's child at the given index.

Specified by:
getChildAt in interface Node
Throws:
java.lang.IndexOutOfBoundsException

getChildCount

public int getChildCount()
Returns the number of children for this node.

Specified by:
getChildCount in interface Node
Returns:
number of children

getIndexOfChild

public int getIndexOfChild(java.lang.Object child)
Gets index of given child.

Specified by:
getIndexOfChild in interface Node
Parameters:
child - child
Returns:
index, -1 if not found

toString

public java.lang.String toString()
Returns string representation of this object.

Returns:
string representation

getPropertyNode

public PropertyNode getPropertyNode()

getLeafNodes

public java.util.List getLeafNodes()
Specified by:
getLeafNodes in interface Node

children

public java.util.Iterator children()
Specified by:
children in interface Node

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface Node

getParent

public Node getParent()
Specified by:
getParent in interface Node

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface Node

addNotify

public void addNotify(javax.swing.event.TreeModelEvent event)
Specified by:
addNotify in interface Node

getLeafNodeCount

public int getLeafNodeCount()
Returns the number of leaf nodes in this tree.

Specified by:
getLeafNodeCount in interface Node
Returns:
number of leaf nodes.

removeNotify

public void removeNotify(javax.swing.event.TreeModelEvent event)
Specified by:
removeNotify in interface Node