gov.usda.gdpc.gui.dbetree
Class ValueNode

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

public class ValueNode
extends java.lang.Object
implements Node

Author:
terryc

Constructor Summary
ValueNode(java.lang.Object value, java.util.List properties, Node parent)
          ValueNode Constructor.
 
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()
           
 Property getProperty()
          Returns this nodes property.
 java.lang.Object getValue()
          Returns value associated with this node.
 boolean isLeaf()
           
 boolean remove(DBElement element)
          Removes given element from this node down.
 boolean removeAll()
           
 void removeNotify(javax.swing.event.TreeModelEvent event)
           
 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

ValueNode

public ValueNode(java.lang.Object value,
                 java.util.List properties,
                 Node parent)
ValueNode Constructor.

Method Detail

add

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

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

remove

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

Specified by:
remove in interface Node
Parameters:
element - element to remove
Returns:
tree model event

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.

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

getValue

public java.lang.Object getValue()
Returns value associated with this node.

Returns:
value

getProperty

public Property getProperty()
Returns this nodes property.

Returns:
property

toString

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

Returns:
string representation

getLeafNodes

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

getLeafNodeCount

public int getLeafNodeCount()
Specified by:
getLeafNodeCount 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

removeNotify

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

removeAll

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