directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r761222 - in /directory/apacheds/branches/ldif-partition: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ core-avl/src/main/java/org/apache/directory/server/core/avltree/ core-avl/src/test/java/org/apache/directo...
Date Thu, 02 Apr 2009 10:00:49 GMT
Author: akarasulu
Date: Thu Apr  2 10:00:49 2009
New Revision: 761222

URL: http://svn.apache.org/viewvc?rev=761222&view=rev
Log:
extracting interface from AvlTreeImpl as AvlTree and using interface where appropriate

Added:
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java
Modified:
    directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java
    directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMap.java
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
    directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
    directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java
    directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
    directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
    directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java
    directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
    directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
    directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java
    directory/apacheds/branches/ldif-partition/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java

Modified: directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java (original)
+++ directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java Thu Apr  2 10:00:49 2009
@@ -22,7 +22,7 @@
 
 import java.util.Comparator;
 
-import org.apache.directory.server.core.avltree.AvlTreeImpl;
+import org.apache.directory.server.core.avltree.AvlTree;
 import org.apache.directory.server.core.avltree.AvlTreeCursor;
 import org.apache.directory.server.core.avltree.AvlTreeMap;
 import org.apache.directory.server.core.avltree.AvlTreeMapNoDupsCursor;
@@ -96,9 +96,9 @@
         }
         
         V val = node.getValue();
-        if ( val instanceof AvlTreeImpl )
+        if ( val instanceof AvlTree )
         {
-            return ( ( AvlTreeImpl ) val ).getSize();
+            return ( ( AvlTree ) val ).getSize();
         }
         
         return 1;
@@ -123,9 +123,9 @@
         }
         
         V val = node.getValue();
-        if ( val instanceof AvlTreeImpl )
+        if ( val instanceof AvlTree )
         {
-            return ( ( AvlTreeImpl<V> ) val ).getFirst().getKey();
+            return ( ( AvlTree<V> ) val ).getFirst().getKey();
         }
         
         return val;
@@ -227,9 +227,9 @@
             return false;
         }
         
-        if ( node.getValue() instanceof AvlTreeImpl )
+        if ( node.getValue() instanceof AvlTree )
         {
-            AvlTreeImpl<V> values = ( AvlTreeImpl<V> ) node.getValue();
+            AvlTree<V> values = ( AvlTree<V> ) node.getValue();
             return values.findGreaterOrEqual( val ) != null;
         }
         
@@ -268,9 +268,9 @@
             return false;
         }
         
-        if ( node.getValue() instanceof AvlTreeImpl )
+        if ( node.getValue() instanceof AvlTree )
         {
-            AvlTreeImpl<V> values = ( AvlTreeImpl<V> ) node.getValue();
+            AvlTree<V> values = ( AvlTree<V> ) node.getValue();
             return values.findLessOrEqual( val ) != null;
         }
         
@@ -350,9 +350,9 @@
         
         V value = node.getValue();
         
-        if ( value instanceof AvlTreeImpl )
+        if ( value instanceof AvlTree )
         {
-            count -= ( ( AvlTreeImpl ) value ).getSize();
+            count -= ( ( AvlTree ) value ).getSize();
             avl.remove( key, null );
         }
         else
@@ -407,9 +407,9 @@
         }
         
         V value = node.getValue();
-        if ( value instanceof AvlTreeImpl )
+        if ( value instanceof AvlTree )
         {
-            return new KeyTupleAvlCursor<K,V>( ( AvlTreeImpl<V> ) value, key );
+            return new KeyTupleAvlCursor<K,V>( ( AvlTree<V> ) value, key );
         }
         
         return new SingletonCursor<Tuple<K,V>>( new Tuple<K,V>( key, value ) );
@@ -434,9 +434,9 @@
         }
         
         V value = node.getValue();
-        if ( value instanceof AvlTreeImpl )
+        if ( value instanceof AvlTree )
         {
-            return new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) value );
+            return new AvlTreeCursor<V>( ( AvlTree<V> ) value );
         }
         
         return new SingletonCursor<V>( value );

Modified: directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java (original)
+++ directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java Thu Apr  2 10:00:49 2009
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.partition.avl;
 
 
-import org.apache.directory.server.core.avltree.AvlTreeImpl;
+import org.apache.directory.server.core.avltree.AvlTree;
 import org.apache.directory.server.core.avltree.AvlTreeCursor;
 import org.apache.directory.server.core.avltree.AvlTreeMapNoDupsCursor;
 import org.apache.directory.server.core.cursor.Cursor;
@@ -121,9 +121,9 @@
         {
             wrappedTuple.setBoth( wrappedCursor.get() );
             
-            if ( wrappedTuple.getValue() instanceof AvlTreeImpl )
+            if ( wrappedTuple.getValue() instanceof AvlTree )
             {
-                AvlTreeImpl<V> avlTree = ( AvlTreeImpl<V> ) wrappedTuple.getValue();
+                AvlTree<V> avlTree = ( AvlTree<V> ) wrappedTuple.getValue();
                 dupsCursor = new AvlTreeCursor<V>( avlTree );
             }
             else
@@ -207,9 +207,9 @@
             wrappedTuple.setBoth( wrappedCursor.get() );
             V values = wrappedTuple.getValue();
 
-            if ( values instanceof AvlTreeImpl )
+            if ( values instanceof AvlTree )
             {
-                AvlTreeImpl<V> set = ( AvlTreeImpl<V> ) values;
+                AvlTree<V> set = ( AvlTree<V> ) values;
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -298,9 +298,9 @@
             wrappedTuple.setBoth( wrappedCursor.get() );
             V values = wrappedTuple.getValue();
 
-            if ( values instanceof AvlTreeImpl )
+            if ( values instanceof AvlTree )
             {
-                dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values );
+                dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values );
             }
             else
             {
@@ -363,9 +363,9 @@
             wrappedTuple.setBoth( wrappedCursor.get() );
             V values = wrappedTuple.getValue();
 
-            if ( values instanceof AvlTreeImpl )
+            if ( values instanceof AvlTree )
             {
-                dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values );
+                dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values );
             }
             else
             {
@@ -410,9 +410,9 @@
                 wrappedTuple.setBoth( wrappedCursor.get() );
                 V values = wrappedTuple.getValue();
 
-                if ( values instanceof AvlTreeImpl )
+                if ( values instanceof AvlTree )
                 {
-                    dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values );
+                    dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values );
                 }
                 else
                 {
@@ -471,9 +471,9 @@
                 wrappedTuple.setBoth( wrappedCursor.get() );
                 V values = wrappedTuple.getValue();
 
-                if ( values instanceof AvlTreeImpl )
+                if ( values instanceof AvlTree )
                 {
-                    dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values );
+                    dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values );
                 }
                 else
                 {

Added: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java?rev=761222&view=auto
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java (added)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java Thu Apr  2 10:00:49 2009
@@ -0,0 +1,158 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.core.avltree;
+
+
+import java.util.Comparator;
+import java.util.List;
+
+
+/**
+ * The interface for an AVL Tree.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface AvlTree<K>
+{
+
+    /**
+     * @return the comparator associated with this tree 
+     */
+    public abstract Comparator<K> getComparator();
+
+
+    /**
+     * Inserts a LinkedAvlNode with the given key.
+     *
+     * @param key the item to be inserted
+     * @return the replaced key if it already exists
+     * Note: Ignores if a node with the given key already exists.
+     */
+    public abstract K insert( K key );
+
+
+    /**
+     * Removes the LinkedAvlNode present in the tree with the given key value
+     *
+     * @param key the value of the node to be removed
+     * @return the removed key, if any, or null if the key does not exist
+     */
+    public abstract K remove( K key );
+
+
+    /**
+     * Tests if the tree is logically empty.
+     * 
+     * @return true if the tree is empty, false otherwise
+     */
+    public abstract boolean isEmpty();
+
+
+    /**
+     * returns the number of nodes present in this tree.
+     * 
+     * @return the number of nodes present in this tree
+     */
+    //NOTE: This method is internally used by AVLTreeMarshaller
+    public abstract int getSize();
+
+
+    /**
+     * @return the root element of this tree (ie, not the first, but the
+     * topmost element)
+     */
+    public abstract LinkedAvlNode<K> getRoot();
+
+
+    /**
+     * @return a list of the stored keys in this tree
+     */
+    public abstract List<K> getKeys();
+
+
+    /**
+     * Prints the contents of AVL tree in pretty format
+     */
+    public abstract void printTree();
+
+
+    /**
+     * @return The first element of this tree
+     */
+    public abstract LinkedAvlNode<K> getFirst();
+
+
+    /**
+     * @return The last element in this tree
+     */
+    public abstract LinkedAvlNode<K> getLast();
+
+
+    /**
+     * Finds a LinkedAvlNode<K> whose key is higher than the given key.
+     *
+     * @param key the key
+     * @return the LinkedAvlNode<K> whose key is greater than the given key ,<br>
+     *         null if there is no node with a higher key than the given key.
+     */
+    public abstract LinkedAvlNode<K> findGreater( K key );
+
+
+    /**
+     * Finds a LinkedAvlNode<K> whose key is higher than the given key.
+     *
+     * @param key the key
+     * @return the LinkedAvlNode<K> whose key is greater than the given key ,<br>
+     *         null if there is no node with a higher key than the given key.
+     */
+    public abstract LinkedAvlNode<K> findGreaterOrEqual( K key );
+
+
+    /**
+     * Finds a LinkedAvlNode<K> whose key is lower than the given key.
+     *
+     * @param key the key
+     * @return the LinkedAvlNode<K> whose key is lower than the given key ,<br>
+     *         null if there is no node with a lower key than the given key.
+     */
+    public abstract LinkedAvlNode<K> findLess( K key );
+
+
+    /**
+     * Finds a LinkedAvlNode<K> whose key is lower than the given key.
+     *
+     * @param key the key
+     * @return the LinkedAvlNode<K> whose key is lower than the given key ,<br>
+     *         null if there is no node with a lower key than the given key.
+     */
+    public abstract LinkedAvlNode<K> findLessOrEqual( K key );
+
+
+    /**
+     * 
+     * Find a LinkedAvlNode with the given key value in the tree.
+     *
+     * @param key the key to find
+     * @return the list of traversed LinkedAvlNode.
+     */
+    public abstract LinkedAvlNode<K> find( K key );
+
+}
\ No newline at end of file

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java Thu Apr  2 10:00:49 2009
@@ -32,14 +32,14 @@
  */
 public class AvlTreeCursor<K> extends AbstractCursor<K>
 {
-    private AvlTreeImpl<K> tree;
+    private AvlTree<K> tree;
     private LinkedAvlNode<K> node;
     private boolean onNode = false;
     private boolean isAfterLast = false;
     private boolean isBeforeFirst = true;
  
     
-    public AvlTreeCursor( AvlTreeImpl<K> tree )
+    public AvlTreeCursor( AvlTree<K> tree )
     {
         this.tree = tree;
     }

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java Thu Apr  2 10:00:49 2009
@@ -31,7 +31,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AvlTreeImpl<K>
+public class AvlTreeImpl<K> implements AvlTree<K>
 {
     /** the root of the tree */
     private LinkedAvlNode<K> root;
@@ -57,8 +57,8 @@
     }
     
     
-    /**
-     * @return the comparator associated with this tree 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#getComparator()
      */
     public Comparator<K> getComparator()
     {
@@ -66,12 +66,8 @@
     }
     
     
-    /**
-     * Inserts a LinkedAvlNode with the given key.
-     *
-     * @param key the item to be inserted
-     * @return the replaced key if it already exists
-     * Note: Ignores if a node with the given key already exists.
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#insert(K)
      */
     public K insert( K key )
     {
@@ -201,11 +197,8 @@
     }
     
     
-    /**
-     * Removes the LinkedAvlNode present in the tree with the given key value
-     *
-     * @param key the value of the node to be removed
-     * @return the removed key, if any, or null if the key does not exist
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#remove(K)
      */
     public K remove( K key )
     {
@@ -367,10 +360,8 @@
     }
     
 
-    /**
-     * Tests if the tree is logically empty.
-     * 
-     * @return true if the tree is empty, false otherwise
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#isEmpty()
      */
     public boolean isEmpty()
     {
@@ -378,10 +369,8 @@
     }
 
     
-    /**
-     * returns the number of nodes present in this tree.
-     * 
-     * @return the number of nodes present in this tree
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#getSize()
      */
     //NOTE: This method is internally used by AVLTreeMarshaller
     public int getSize()
@@ -447,9 +436,8 @@
     }
 
 
-    /**
-     * @return the root element of this tree (ie, not the first, but the
-     * topmost element)
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#getRoot()
      */
     public LinkedAvlNode<K> getRoot()
     {
@@ -457,8 +445,8 @@
     }
     
     
-    /**
-     * @return a list of the stored keys in this tree
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#getKeys()
      */
     public List<K> getKeys()
     {
@@ -474,8 +462,8 @@
         return keys;
     }
 
-    /**
-     * Prints the contents of AVL tree in pretty format
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#printTree()
      */
     public void printTree() 
     {
@@ -495,8 +483,8 @@
     }
     
 
-    /**
-     * @return The first element of this tree
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#getFirst()
      */
     public LinkedAvlNode<K> getFirst()
     {
@@ -504,8 +492,8 @@
     }
 
     
-    /**
-     * @return The last element in this tree
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#getLast()
      */
     public LinkedAvlNode<K> getLast()
     {
@@ -677,12 +665,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlNode<K> whose key is higher than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlNode<K> whose key is greater than the given key ,<br>
-     *         null if there is no node with a higher key than the given key.
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#findGreater(K)
      */
     public LinkedAvlNode<K> findGreater( K key )
     {
@@ -701,12 +685,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlNode<K> whose key is higher than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlNode<K> whose key is greater than the given key ,<br>
-     *         null if there is no node with a higher key than the given key.
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#findGreaterOrEqual(K)
      */
     public LinkedAvlNode<K> findGreaterOrEqual( K key )
     {
@@ -725,12 +705,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlNode<K> whose key is lower than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlNode<K> whose key is lower than the given key ,<br>
-     *         null if there is no node with a lower key than the given key.
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#findLess(K)
      */
     public LinkedAvlNode<K> findLess( K key )
     {
@@ -749,12 +725,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlNode<K> whose key is lower than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlNode<K> whose key is lower than the given key ,<br>
-     *         null if there is no node with a lower key than the given key.
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#findLessOrEqual(K)
      */
     public LinkedAvlNode<K> findLessOrEqual( K key )
     {
@@ -802,12 +774,8 @@
         return startNode;
     }
     
-    /**
-     * 
-     * Find a LinkedAvlNode with the given key value in the tree.
-     *
-     * @param key the key to find
-     * @return the list of traversed LinkedAvlNode.
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTree#find(K)
      */
     public LinkedAvlNode<K> find( K key )
     {

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMap.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMap.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMap.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMap.java Thu Apr  2 10:00:49 2009
@@ -173,11 +173,11 @@
     @SuppressWarnings("unchecked")
     private K insertDupKey( K key, V value, LinkedAvlMapNode existingNode )
     {
-        AvlTreeImpl<V> dupsTree = null;
+        AvlTree<V> dupsTree = null;
         
-        if( existingNode.value instanceof AvlTreeImpl )
+        if( existingNode.value instanceof AvlTree )
         {
-            dupsTree = ( AvlTreeImpl<V> ) existingNode.value;
+            dupsTree = ( AvlTree<V> ) existingNode.value;
         }
         else
         {
@@ -293,9 +293,9 @@
         // check if the value matches
         if( value != null )
         {
-            if( temp.value instanceof AvlTreeImpl )
+            if( temp.value instanceof AvlTree )
             {
-                AvlTreeImpl<V> dupsTree = ( AvlTreeImpl<V> ) temp.value;
+                AvlTree<V> dupsTree = ( AvlTree<V> ) temp.value;
                 V removedVal = dupsTree.remove( value );
                 
                 // if the removal is successful and the tree is not empty
@@ -925,9 +925,9 @@
             return null;
         }
         
-        if( node.value instanceof AvlTreeImpl )
+        if( node.value instanceof AvlTree )
         {
-            AvlTreeImpl<V> dupsTree = ( AvlTreeImpl<V> ) node.value;
+            AvlTree<V> dupsTree = ( AvlTree<V> ) node.value;
             
             if( dupsTree.find( value ) == null )
             {

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java Thu Apr  2 10:00:49 2009
@@ -35,7 +35,7 @@
  * @version $Rev$, $Date$
  */
 @SuppressWarnings("unchecked")
-public class AvlTreeMarshaller<E> implements Marshaller<AvlTreeImpl<E>>
+public class AvlTreeMarshaller<E> implements Marshaller<AvlTree<E>>
 {
     /** used for serialized form of an empty AvlTree */
     private static final byte[] EMPTY_TREE = new byte[1];
@@ -78,7 +78,7 @@
      * Marshals the given tree to bytes
      * @param tree the tree to be marshalled
      */
-    public byte[] serialize( AvlTreeImpl<E> tree )
+    public byte[] serialize( AvlTree<E> tree )
     {
         if( tree.isEmpty() )
         {
@@ -162,7 +162,7 @@
      * 
      * @param data byte array to be converted into AVLTree  
      */
-    public AvlTreeImpl<E> deserialize( byte[] data ) throws IOException
+    public AvlTree<E> deserialize( byte[] data ) throws IOException
     {
         if ( data == null || data.length == 0 )
         {

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java Thu Apr  2 10:00:49 2009
@@ -24,12 +24,12 @@
 
 
 /**
- * A marshaller which uses default Java Serialization.
+ * A Marshaller which uses default Java Serialization.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DefaultMarshaller implements Marshaller
+public class DefaultMarshaller implements Marshaller<Object>
 {
     public static final DefaultMarshaller INSTANCE = new DefaultMarshaller();
 

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java Thu Apr  2 10:00:49 2009
@@ -22,7 +22,6 @@
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.server.xdbm.AbstractTupleCursor;
-import org.apache.directory.server.core.avltree.AvlTreeImpl;
 import org.apache.directory.server.core.avltree.AvlTreeCursor;
 
 
@@ -49,7 +48,7 @@
      * @param avlTree the AvlTree to build a Tuple returning Cursor over
      * @param key the constant key for which values are returned
      */
-    public KeyTupleAvlCursor( AvlTreeImpl<V> avlTree, K key )
+    public KeyTupleAvlCursor( AvlTree<V> avlTree, K key )
     {
         this.key = key;
         this.wrapped = new AvlTreeCursor<V>( avlTree );

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java Thu Apr  2 10:00:49 2009
@@ -39,7 +39,7 @@
     @Test
     public void testEmptyCursor() throws Exception
     {
-        AvlTreeImpl<Integer> tree = new AvlTreeImpl<Integer>( new IntegerComparator() );
+        AvlTree<Integer> tree = new AvlTreeImpl<Integer>( new IntegerComparator() );
         AvlTreeCursor<Integer> cursor = new AvlTreeCursor<Integer>( tree );
         
         assertFalse( cursor.isClosed() );
@@ -88,7 +88,7 @@
     @Test
     public void testOneEntryCursor() throws Exception
     {
-        AvlTreeImpl<Integer> tree = new AvlTreeImpl<Integer>( new IntegerComparator() );
+        AvlTree<Integer> tree = new AvlTreeImpl<Integer>( new IntegerComparator() );
         tree.insert( 7 );
         AvlTreeCursor<Integer> cursor = new AvlTreeCursor<Integer>( tree );
         
@@ -152,7 +152,7 @@
     @Test
     public void testManyEntriesCursor() throws Exception
     {
-        AvlTreeImpl<Integer> tree = new AvlTreeImpl<Integer>( new IntegerComparator() );
+        AvlTree<Integer> tree = new AvlTreeImpl<Integer>( new IntegerComparator() );
         tree.insert( 3 );
         tree.insert( 7 );
         tree.insert( 10 );

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java Thu Apr  2 10:00:49 2009
@@ -303,7 +303,7 @@
         
         assertEquals( AvlTreeImpl.class, t.getValue().getClass() );
         
-        AvlTreeImpl dupsTree = ( AvlTreeImpl ) t.getValue();
+        AvlTree dupsTree = ( AvlTree ) t.getValue();
         assertEquals( 3, dupsTree.getSize() );
         
         AvlTreeCursor valCursor = new AvlTreeCursor<Integer>( dupsTree );

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java Thu Apr  2 10:00:49 2009
@@ -191,7 +191,7 @@
      
         assertTrue( node.value.getClass() ==  AvlTreeImpl.class );
         
-        AvlTreeImpl dupsTree = ( AvlTreeImpl ) node.value;
+        AvlTree dupsTree = ( AvlTree ) node.value;
         assertEquals( 3, dupsTree.getSize() );
     }
     

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java (original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java Thu Apr  2 10:00:49 2009
@@ -91,7 +91,7 @@
     Comparator<Integer> comparator;
     AvlTreeMarshaller<Integer> treeMarshaller;
     
-    static AvlTreeImpl<Integer> savedTree;
+    static AvlTree<Integer> savedTree;
     
     static File treeFile = new File( System.getProperty( "java.io.tmpdir" ) + File.separator + "avl.tree");
     
@@ -140,7 +140,7 @@
          */
 
         AvlTreeMarshaller<Long> treeMarshaller = new AvlTreeMarshaller<Long>( comparator, new LongMarshaller() );
-        AvlTreeImpl<Long> tree = treeMarshaller.deserialize( SERIALIZED_AVLTREE_PRE_REMOVE );
+        AvlTree<Long> tree = treeMarshaller.deserialize( SERIALIZED_AVLTREE_PRE_REMOVE );
         
         for ( long key : AVLTREE_KEYS_PRE_REMOVE )
         {
@@ -165,7 +165,7 @@
     public void testMarshalEmptyTree() throws IOException
     {
         byte[] bites = treeMarshaller.serialize( new AvlTreeImpl<Integer>( comparator ) );
-        AvlTreeImpl<Integer> tree = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> tree = treeMarshaller.deserialize( bites );
         assertNotNull( tree );
     }
 
@@ -175,7 +175,7 @@
     {
         AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertTrue( deserialized.isEmpty() );
     }
 
@@ -186,7 +186,7 @@
         AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator );
         original.insert( 0 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 1, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -199,7 +199,7 @@
         AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator );
         original.insert( 0 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 1, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -226,7 +226,7 @@
         original.insert( 0 );
         original.insert( 1 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 2, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -241,7 +241,7 @@
         original.insert( 0 );
         original.insert( 1 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 2, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -271,7 +271,7 @@
             original.insert( ii );
         }
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 100, deserialized.getSize() );
 
@@ -294,7 +294,7 @@
             original.insert( ii );
         }
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 100, deserialized.getSize() );
 
@@ -340,7 +340,7 @@
 
         AvlTreeMarshaller<Bar> marshaller = new AvlTreeMarshaller<Bar>( barComparator );
         byte[] bites = marshaller.serialize( original );
-        AvlTreeImpl<Bar> deserialized = marshaller.deserialize( bites );
+        AvlTree<Bar> deserialized = marshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 100, deserialized.getSize() );
 
@@ -412,7 +412,7 @@
         byte[] data = new byte[ ( int )treeFile.length() ];
         fin.read( data );
         
-        AvlTreeImpl<Integer> unmarshalledTree = treeMarshaller.deserialize( data );
+        AvlTree<Integer> unmarshalledTree = treeMarshaller.deserialize( data );
         
         if( LOG.isDebugEnabled() )
         {

Modified: directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java (original)
+++ directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java Thu Apr  2 10:00:49 2009
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.apache.directory.server.core.avltree.AvlTreeImpl;
+import org.apache.directory.server.core.avltree.AvlTree;
 
 
 /**
@@ -34,11 +34,11 @@
  */
 public class DupsContainer<V>
 {
-    private final AvlTreeImpl<V> avlTree;
+    private final AvlTree<V> avlTree;
     private final BTreeRedirect btreeRedirect;
 
 
-    DupsContainer( AvlTreeImpl<V> avlTree )
+    DupsContainer( AvlTree<V> avlTree )
     {
         this.avlTree = avlTree;
         btreeRedirect = null;
@@ -64,7 +64,7 @@
     }
 
 
-    final AvlTreeImpl<V> getAvlTree()
+    final AvlTree<V> getAvlTree()
     {
         if ( avlTree == null )
         {

Modified: directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java (original)
+++ directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java Thu Apr  2 10:00:49 2009
@@ -22,7 +22,7 @@
 
 import jdbm.btree.BTree;
 
-import org.apache.directory.server.core.avltree.AvlTreeImpl;
+import org.apache.directory.server.core.avltree.AvlTree;
 import org.apache.directory.server.core.avltree.AvlTreeCursor;
 import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
@@ -114,7 +114,7 @@
 
             if ( values.isAvlTree() )
             {
-                AvlTreeImpl<V> set = values.getAvlTree();
+                AvlTree<V> set = values.getAvlTree();
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -189,7 +189,7 @@
 
             if ( values.isAvlTree() )
             {
-                AvlTreeImpl<V> set = values.getAvlTree();
+                AvlTree<V> set = values.getAvlTree();
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -302,7 +302,7 @@
 
             if ( values.isAvlTree() )
             {
-                AvlTreeImpl<V> set = values.getAvlTree();
+                AvlTree<V> set = values.getAvlTree();
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -357,7 +357,7 @@
 
                 if ( values.isAvlTree() )
                 {
-                    AvlTreeImpl<V> set = values.getAvlTree();
+                    AvlTree<V> set = values.getAvlTree();
                     dupsCursor = new AvlTreeCursor<V>( set );
                 }
                 else
@@ -408,7 +408,7 @@
 
                 if ( values.isAvlTree() )
                 {
-                    AvlTreeImpl<V> set = values.getAvlTree();
+                    AvlTree<V> set = values.getAvlTree();
                     dupsCursor = new AvlTreeCursor<V>( set );
                 }
                 else

Modified: directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java (original)
+++ directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java Thu Apr  2 10:00:49 2009
@@ -24,7 +24,12 @@
 import jdbm.btree.BTree;
 import jdbm.helper.*;
 
-import org.apache.directory.server.core.avltree.*;
+import org.apache.directory.server.core.avltree.AvlTree;
+import org.apache.directory.server.core.avltree.AvlTreeCursor;
+import org.apache.directory.server.core.avltree.AvlTreeImpl;
+import org.apache.directory.server.core.avltree.AvlTreeMarshaller;
+import org.apache.directory.server.core.avltree.LinkedAvlNode;
+import org.apache.directory.server.core.avltree.Marshaller;
 import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.cursor.EmptyCursor;
 import org.apache.directory.server.core.cursor.SingletonCursor;
@@ -366,7 +371,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTreeImpl<V> set = values.getAvlTree();
+            AvlTree<V> set = values.getAvlTree();
 
             if ( set.getFirst() == null )
             {
@@ -388,7 +393,6 @@
     /**
      * @see Table#hasGreaterOrEqual(Object,Object)
      */
-    @SuppressWarnings("unchecked")
     public boolean hasGreaterOrEqual( K key, V val ) throws IOException
     {
         if ( key == null )
@@ -405,7 +409,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTreeImpl<V> set = values.getAvlTree();
+            AvlTree<V> set = values.getAvlTree();
             LinkedAvlNode<V> result = set.findGreaterOrEqual( val );
             return result != null;
         }
@@ -419,7 +423,6 @@
     /**
      * @see Table#hasLessOrEqual(Object,Object)
      */
-    @SuppressWarnings("unchecked")
     public boolean hasLessOrEqual( K key, V val ) throws IOException
     {
         if ( key == null )
@@ -436,7 +439,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTreeImpl<V> set = values.getAvlTree();
+            AvlTree<V> set = values.getAvlTree();
             LinkedAvlNode<V> result = set.findLessOrEqual( val );
             return result != null;
         }
@@ -587,7 +590,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTreeImpl<V> set = values.getAvlTree();
+            AvlTree<V> set = values.getAvlTree();
             replaced = set.insert( value );
             
             if ( replaced != null )// if the value already present returns the same value
@@ -650,7 +653,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTreeImpl<V> set = values.getAvlTree();
+            AvlTree<V> set = values.getAvlTree();
 
             // If removal succeeds then remove if set is empty else replace it
             if ( set.remove( value ) != null )
@@ -680,7 +683,7 @@
              */
             if ( tree.size() <= numDupLimit )
             {
-                AvlTreeImpl<V> avlTree = convertToAvlTree( tree );
+                AvlTree<V> avlTree = convertToAvlTree( tree );
                 bt.insert( key, marshaller.serialize( avlTree ), true );
                 recMan.delete( tree.getRecid() );
             }
@@ -724,7 +727,7 @@
         }
         else
         {
-            AvlTreeImpl<V> set = marshaller.deserialize( serialized );
+            AvlTree<V> set = marshaller.deserialize( serialized );
             this.count -= set.getSize();
             return;
         }
@@ -769,7 +772,7 @@
             return new KeyTupleBTreeCursor<K,V>( tree, key, valueComparator );
         }
 
-        AvlTreeImpl<V> set = marshaller.deserialize( serialized );
+        AvlTree<V> set = marshaller.deserialize( serialized );
         return new KeyTupleAvlCursor<K,V>( set, key );
     }
 
@@ -831,7 +834,7 @@
     }
 
     
-    public Marshaller<AvlTreeImpl<V>> getMarshaller()
+    public Marshaller<AvlTree<V>> getMarshaller()
     {
         return marshaller;
     }
@@ -931,9 +934,9 @@
 
 
     @SuppressWarnings("unchecked")
-    private AvlTreeImpl<V> convertToAvlTree( BTree bTree ) throws IOException
+    private AvlTree<V> convertToAvlTree( BTree bTree ) throws IOException
     {
-        AvlTreeImpl<V> avlTree = new AvlTreeImpl<V>( valueComparator );
+        AvlTree<V> avlTree = new AvlTreeImpl<V>( valueComparator );
         TupleBrowser browser = bTree.browse();
         jdbm.helper.Tuple tuple = new jdbm.helper.Tuple();
         while ( browser.getNext( tuple ) )
@@ -945,7 +948,7 @@
     }
     
 
-    private BTree convertToBTree( AvlTreeImpl<V> avlTree ) throws Exception
+    private BTree convertToBTree( AvlTree<V> avlTree ) throws Exception
     {
         BTree bTree;
 

Modified: directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java (original)
+++ directory/apacheds/branches/ldif-partition/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java Thu Apr  2 10:00:49 2009
@@ -22,7 +22,7 @@
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.server.xdbm.AbstractTupleCursor;
-import org.apache.directory.server.core.avltree.AvlTreeImpl;
+import org.apache.directory.server.core.avltree.AvlTree;
 import org.apache.directory.server.core.avltree.AvlTreeCursor;
 
 
@@ -49,7 +49,7 @@
      * @param avlTree the AvlTree to build a Tuple returning Cursor over
      * @param key the constant key for which values are returned
      */
-    public KeyTupleAvlCursor( AvlTreeImpl<V> avlTree, K key )
+    public KeyTupleAvlCursor( AvlTree<V> avlTree, K key )
     {
         this.key = key;
         this.wrapped = new AvlTreeCursor<V>( avlTree );

Modified: directory/apacheds/branches/ldif-partition/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java?rev=761222&r1=761221&r2=761222&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java (original)
+++ directory/apacheds/branches/ldif-partition/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java Thu Apr  2 10:00:49 2009
@@ -24,6 +24,7 @@
 
 import java.util.Comparator;
 
+import org.apache.directory.server.core.avltree.AvlTree;
 import org.apache.directory.server.core.avltree.AvlTreeImpl;
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
 import org.apache.directory.server.xdbm.Tuple;
@@ -40,7 +41,7 @@
 public class KeyTupleAvlCursorTest
 {
 
-    AvlTreeImpl<Integer> tree;
+    AvlTree<Integer> tree;
     Comparator<Integer> comparator;
     KeyTupleAvlCursor<Integer, Integer> cursor;
     



Mime
View raw message