gov.usda.gdpc.gui.dbetree
Class PropertyNode

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

public class PropertyNode
extends java.lang.Object
implements Node

Author:
terryc

Constructor Summary
PropertyNode(java.util.List properties, Node parent)
          PropertyNode Constructor.
PropertyNode(Node parent)
          PropertyNode Constructor.
 
Method Summary
 boolean add(DBElement element)
          Adds a DBElement to this property node tree.
 boolean 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()
           
 java.util.List getLeafNodes()
           
 Node getParent()
           
 Property getProperty()
          Returns the property associated with this node.
 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 value nodes from this property node.
 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

PropertyNode

public PropertyNode(java.util.List properties,
                    Node parent)
PropertyNode Constructor.


PropertyNode

public PropertyNode(Node parent)
PropertyNode Constructor.

Method Detail

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 add changed tree.

add

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

Parameters:
list - the list to add.
Returns:
true if this tree changed because of add.

remove

public boolean remove(DBElement element)
Removes given element from this node down. It removes every occurance of the element.

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

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 value nodes from this property node.

Specified by:
removeAll in interface Node
Returns:
true if the tree changed because of this remove.

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

getProperty

public Property getProperty()
Returns the property associated with this node.

Returns:
property, null if empty node.

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