org.annotation.util
Class RecursiveTreeNode

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byorg.annotation.util.RecursiveTreeNode
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, javax.swing.tree.MutableTreeNode, Recursable, java.io.Serializable, javax.swing.tree.TreeNode

public class RecursiveTreeNode
extends javax.swing.tree.DefaultMutableTreeNode
implements Recursable

SortedTreeNode is a data structure to have a sorted tree structure. Nodes are inserted such that any node which is contained by another will be one of its children. Node which are less than or grater than one another will be siblings and sibling will be kept in asscending order from left to right.

See Also:
Serialized Form

Field Summary
protected  Recursable data
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
RecursiveTreeNode(Recursable d)
           
 
Method Summary
 void add(javax.swing.tree.MutableTreeNode n)
           
 boolean addSort(RecursiveTreeNode node)
          Adds a SortedTreeNode to an existing tree inserting it in its proper location.
 int compareTo(java.lang.Object o)
           
 boolean contains(java.lang.Object o)
           
 RecursiveTreeNode getNode(Recursable d)
           
 java.util.List getPathTo(java.lang.Object o)
           
 boolean gt(java.lang.Object o)
           
 boolean hasPathTo(java.lang.Object o)
           
 int indexOf(java.lang.Object o)
           
 boolean intersects(java.lang.Object o)
           
 java.util.Iterator iterator()
           
 boolean lt(java.lang.Object o)
           
 int size()
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected Recursable data
Constructor Detail

RecursiveTreeNode

public RecursiveTreeNode(Recursable d)
Method Detail

getNode

public RecursiveTreeNode getNode(Recursable d)

addSort

public boolean addSort(RecursiveTreeNode node)
Adds a SortedTreeNode to an existing tree inserting it in its proper location. The node in the tree where this node is placed is returned. This will be node unless a node in the tree with the same span already exist.


add

public void add(javax.swing.tree.MutableTreeNode n)

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface Recursable

size

public int size()
Specified by:
size in interface Recursable

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface Recursable

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface Recursable

hasPathTo

public boolean hasPathTo(java.lang.Object o)
Specified by:
hasPathTo in interface Recursable

getPathTo

public java.util.List getPathTo(java.lang.Object o)
Specified by:
getPathTo in interface Recursable

intersects

public boolean intersects(java.lang.Object o)
Specified by:
intersects in interface Recursable

lt

public boolean lt(java.lang.Object o)
Specified by:
lt in interface Recursable

gt

public boolean gt(java.lang.Object o)
Specified by:
gt in interface Recursable


Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.