directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r620590 - /directory/sandbox/akarasulu/bigbang/apacheds/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java
Date Mon, 11 Feb 2008 19:39:59 GMT
Author: akarasulu
Date: Mon Feb 11 11:39:58 2008
New Revision: 620590

URL: http://svn.apache.org/viewvc?rev=620590&view=rev
Log:
DIRSERVER-1130: Applying patch from Kiran Ayyagari for splay tree nodes

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java?rev=620590&r1=620589&r2=620590&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-splay/src/main/java/org/apache/directory/server/core/splay/LinkedBinaryNode.java
Mon Feb 11 11:39:58 2008
@@ -34,10 +34,53 @@
     LinkedBinaryNode<T> next;
     LinkedBinaryNode<T> previous;
     
+    transient int depth;
     
     LinkedBinaryNode( T theKey )
     {
         key = theKey;
         left = right = null;
     }
+
+
+	public LinkedBinaryNode<T> getLeft() {
+		return left;
+	}
+
+
+	public LinkedBinaryNode<T> getRight() {
+		return right;
+	}
+
+	public T getKey() {
+		return key;
+	}
+
+	public boolean isLeaf()
+	{
+		return ( right == null && left == null );
+	}
+	
+	/**
+	 * This method is used for internal purpose only while pretty printing the tree.<br>
+	 * @return the depth at the this node
+	 */
+	public int getDepth() {
+		return depth;
+	}
+
+    /**
+     * This method is used for internal purpose only while pretty printing the tree.<br>
+     * @param depth value representing the depth of the this node
+     */
+	public void setDepth( int depth ) {
+		this.depth = depth;
+	}
+
+	@Override
+	public String toString() {
+	    return "[" + key + "]";
+	}
+    
+    
 }



Mime
View raw message