Clover coverage report - baseCode - 0.2.5
Coverage timestamp: Tue Apr 12 2005 11:31:58 EDT
file stats: LOC: 66   Methods: 9
NCLOC: 34   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
BinaryTree.java 0% 0% 0% 0%
coverage
 1   
 package baseCode.dataStructure.tree;
 2   
 
 3   
 /**
 4   
  * <hr>
 5   
  * <p>
 6   
  * Copyright (c) 2004 Columbia University
 7   
  * 
 8   
  * @author Paul Pavlidis
 9   
  * @version $Id: BinaryTree.java,v 1.1 2004/07/29 08:38:49 pavlidis Exp $
 10   
  */
 11   
 public class BinaryTree {
 12   
 
 13   
    BinaryTreeNode root;
 14   
 
 15  0
    public BinaryTree( BinaryTreeNode root ) {
 16  0
       this.root = root;
 17   
    }
 18   
 
 19   
    /**
 20   
     * @return Returns the root.
 21   
     */
 22  0
    public BinaryTreeNode getRoot() {
 23  0
       return root;
 24   
    }
 25   
 
 26   
    /**
 27   
     * @param root The root to set.
 28   
     */
 29  0
    public void setRoot( BinaryTreeNode root ) {
 30  0
       this.root = root;
 31   
    }
 32   
 
 33   
    /**
 34   
     * 
 35   
     */
 36  0
    public BinaryTree() {
 37  0
       super();
 38   
       // TODO Auto-generated constructor stub
 39   
    }
 40   
 
 41  0
    public void insertLeft( BinaryTreeNode p, Object o ) {
 42  0
       if ( ( p != null ) && ( p.getLeft() == null ) )
 43  0
             p.setLeft( new BinaryTreeNode( o ) );
 44   
    }
 45   
 
 46  0
    public void insertRight( BinaryTreeNode p, Object o ) {
 47  0
       if ( ( p != null ) && ( p.getRight() == null ) )
 48  0
             p.setRight( new BinaryTreeNode( o ) );
 49   
    }
 50   
 
 51  0
    public BinaryTreeNode getLeft() {
 52  0
       if ( !isEmpty() ) return root.getLeft();
 53  0
       return null;
 54   
    }
 55   
 
 56  0
    public BinaryTreeNode getRight() {
 57  0
       if ( !isEmpty() ) return root.getRight();
 58  0
       return null;
 59   
    }
 60   
 
 61  0
    public boolean isEmpty() {
 62  0
       return getRoot() == null;
 63   
 
 64   
    }
 65   
 
 66   
 }