View Javadoc

    1   package baseCode.dataStructure.tree;
    2
    3   import baseCode.common.Visitable;
    4
    5   /***
    6    *
    7    *
    8    * <hr>
    9    * <p>Copyright (c) 2004 Columbia University
    10   * @author pavlidis
    11   * @version $Id: TreeNode.java,v 1.1 2004/07/29 08:38:49 pavlidis Exp $
    12   */
    13  public class TreeNode extends Visitable {
    14
    15     private Object element;
    16     private TreeNode firstChild;
    17     private TreeNode nextSibling;
    18
    19     public Object getElement() {
    20        return element;
    21     }
    22     public void setElement( Object element ) {
    23        this.element = element;
    24     }
    25     public TreeNode getFirstChild() {
    26        return firstChild;
    27     }
    28     public void setFirstChild( TreeNode firstChild ) {
    29        this.firstChild = firstChild;
    30     }
    31     public TreeNode getNextSibling() {
    32        return nextSibling;
    33     }
    34     public void setNextSibling( TreeNode nextSibling ) {
    35        this.nextSibling = nextSibling;
    36     }
    37     /***
    38      *
    39      */
    40     public TreeNode(Object k) {
    41        element = k;
    42     }
    43     /* (non-Javadoc)
    44      * @see java.lang.Comparable#compareTo(java.lang.Object)
    45      */
    46     public int compareTo( Object o ) {
    47        return 0;
    48     }
    49
    50
    51
    52  }