gov.usda.gdpc.gui.dbetree
Interface Node

All Known Implementing Classes:
HeadNode, PropertyNode, ValueNode

public interface Node

Author:
terryc

Method Summary
 boolean add(DBElement element)
          Adds the given DBElement to this value 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()
           
 java.util.List getLeafNodes()
           
 Node getParent()
           
 boolean isLeaf()
           
 boolean remove(DBElement element)
          Removes given element from this node down.
 boolean removeAll()
           
 void removeNotify(javax.swing.event.TreeModelEvent event)
           
 

Method Detail

add

public boolean add(DBElement element)
Adds the given DBElement to this value node tree.

Parameters:
element - the element to add.
Returns:
true if add changed tree.

addNotify

public void addNotify(javax.swing.event.TreeModelEvent event)

removeNotify

public void removeNotify(javax.swing.event.TreeModelEvent event)

remove

public boolean remove(DBElement element)
Removes given element from this node down. If removes all occurances of this element.

Parameters:
element - element to remove
Returns:
true if remove changed tree.

removeAll

public boolean removeAll()

getChildAt

public java.lang.Object getChildAt(int index)
                            throws java.lang.IndexOutOfBoundsException
Returns this node's child at the given index. If this node has a child property node, that is the only child.

Throws:
java.lang.IndexOutOfBoundsException

getChildCount

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

Returns:
number of children

getIndexOfChild

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

Parameters:
child - child
Returns:
index, -1 if not found

getLeafNodes

public java.util.List getLeafNodes()

getLeafNodeCount

public int getLeafNodeCount()

children

public java.util.Iterator children()

getAllowsChildren

public boolean getAllowsChildren()

getParent

public Node getParent()

isLeaf

public boolean isLeaf()