directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r761218 - 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 09:42:02 GMT
Author: akarasulu
Date: Thu Apr  2 09:42:01 2009
New Revision: 761218

URL: http://svn.apache.org/viewvc?rev=761218&view=rev
Log:
renaming AvlTree to AvlTreeImpl to extract interface so we can create a singleton implementation

Added:
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
      - copied, changed from r760428, directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java
Removed:
    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/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/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/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/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreePerfTest.java
    directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -22,7 +22,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.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 AvlTree )
+        if ( val instanceof AvlTreeImpl )
         {
-            return ( ( AvlTree ) val ).getSize();
+            return ( ( AvlTreeImpl ) val ).getSize();
         }
         
         return 1;
@@ -123,9 +123,9 @@
         }
         
         V val = node.getValue();
-        if ( val instanceof AvlTree )
+        if ( val instanceof AvlTreeImpl )
         {
-            return ( ( AvlTree<V> ) val ).getFirst().getKey();
+            return ( ( AvlTreeImpl<V> ) val ).getFirst().getKey();
         }
         
         return val;
@@ -227,9 +227,9 @@
             return false;
         }
         
-        if ( node.getValue() instanceof AvlTree )
+        if ( node.getValue() instanceof AvlTreeImpl )
         {
-            AvlTree<V> values = ( AvlTree<V> ) node.getValue();
+            AvlTreeImpl<V> values = ( AvlTreeImpl<V> ) node.getValue();
             return values.findGreaterOrEqual( val ) != null;
         }
         
@@ -268,9 +268,9 @@
             return false;
         }
         
-        if ( node.getValue() instanceof AvlTree )
+        if ( node.getValue() instanceof AvlTreeImpl )
         {
-            AvlTree<V> values = ( AvlTree<V> ) node.getValue();
+            AvlTreeImpl<V> values = ( AvlTreeImpl<V> ) node.getValue();
             return values.findLessOrEqual( val ) != null;
         }
         
@@ -350,9 +350,9 @@
         
         V value = node.getValue();
         
-        if ( value instanceof AvlTree )
+        if ( value instanceof AvlTreeImpl )
         {
-            count -= ( ( AvlTree ) value ).getSize();
+            count -= ( ( AvlTreeImpl ) value ).getSize();
             avl.remove( key, null );
         }
         else
@@ -407,9 +407,9 @@
         }
         
         V value = node.getValue();
-        if ( value instanceof AvlTree )
+        if ( value instanceof AvlTreeImpl )
         {
-            return new KeyTupleAvlCursor<K,V>( ( AvlTree<V> ) value, key );
+            return new KeyTupleAvlCursor<K,V>( ( AvlTreeImpl<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 AvlTree )
+        if ( value instanceof AvlTreeImpl )
         {
-            return new AvlTreeCursor<V>( ( AvlTree<V> ) value );
+            return new AvlTreeCursor<V>( ( AvlTreeImpl<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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.partition.avl;
 
 
-import org.apache.directory.server.core.avltree.AvlTree;
+import org.apache.directory.server.core.avltree.AvlTreeImpl;
 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 AvlTree )
+            if ( wrappedTuple.getValue() instanceof AvlTreeImpl )
             {
-                AvlTree<V> avlTree = ( AvlTree<V> ) wrappedTuple.getValue();
+                AvlTreeImpl<V> avlTree = ( AvlTreeImpl<V> ) wrappedTuple.getValue();
                 dupsCursor = new AvlTreeCursor<V>( avlTree );
             }
             else
@@ -207,9 +207,9 @@
             wrappedTuple.setBoth( wrappedCursor.get() );
             V values = wrappedTuple.getValue();
 
-            if ( values instanceof AvlTree )
+            if ( values instanceof AvlTreeImpl )
             {
-                AvlTree<V> set = ( AvlTree<V> ) values;
+                AvlTreeImpl<V> set = ( AvlTreeImpl<V> ) values;
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -298,9 +298,9 @@
             wrappedTuple.setBoth( wrappedCursor.get() );
             V values = wrappedTuple.getValue();
 
-            if ( values instanceof AvlTree )
+            if ( values instanceof AvlTreeImpl )
             {
-                dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values );
+                dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values
);
             }
             else
             {
@@ -363,9 +363,9 @@
             wrappedTuple.setBoth( wrappedCursor.get() );
             V values = wrappedTuple.getValue();
 
-            if ( values instanceof AvlTree )
+            if ( values instanceof AvlTreeImpl )
             {
-                dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values );
+                dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values
);
             }
             else
             {
@@ -410,9 +410,9 @@
                 wrappedTuple.setBoth( wrappedCursor.get() );
                 V values = wrappedTuple.getValue();
 
-                if ( values instanceof AvlTree )
+                if ( values instanceof AvlTreeImpl )
                 {
-                    dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values
);
+                    dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values
);
                 }
                 else
                 {
@@ -471,9 +471,9 @@
                 wrappedTuple.setBoth( wrappedCursor.get() );
                 V values = wrappedTuple.getValue();
 
-                if ( values instanceof AvlTree )
+                if ( values instanceof AvlTreeImpl )
                 {
-                    dupsCursor = new AvlTreeCursor<V>( ( AvlTree<V> ) values
);
+                    dupsCursor = new AvlTreeCursor<V>( ( AvlTreeImpl<V> ) values
);
                 }
                 else
                 {

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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -32,14 +32,14 @@
  */
 public class AvlTreeCursor<K> extends AbstractCursor<K>
 {
-    private AvlTree<K> tree;
+    private AvlTreeImpl<K> tree;
     private LinkedAvlNode<K> node;
     private boolean onNode = false;
     private boolean isAfterLast = false;
     private boolean isBeforeFirst = true;
  
     
-    public AvlTreeCursor( AvlTree<K> tree )
+    public AvlTreeCursor( AvlTreeImpl<K> tree )
     {
         this.tree = tree;
     }

Copied: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
(from r760428, 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/AvlTreeImpl.java?p2=directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java&p1=directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java&r1=760428&r2=761218&rev=761218&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTree.java
(original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeImpl.java
Thu Apr  2 09:42:01 2009
@@ -31,7 +31,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AvlTree<K>
+public class AvlTreeImpl<K>
 {
     /** the root of the tree */
     private LinkedAvlNode<K> root;
@@ -51,7 +51,7 @@
      *
      * @param comparator the comparator to be used for comparing keys
      */
-    public AvlTree( Comparator<K> comparator)
+    public AvlTreeImpl( Comparator<K> comparator)
     {
         this.comparator = comparator;
     }

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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -173,15 +173,15 @@
     @SuppressWarnings("unchecked")
     private K insertDupKey( K key, V value, LinkedAvlMapNode existingNode )
     {
-        AvlTree<V> dupsTree = null;
+        AvlTreeImpl<V> dupsTree = null;
         
-        if( existingNode.value instanceof AvlTree )
+        if( existingNode.value instanceof AvlTreeImpl )
         {
-            dupsTree = ( AvlTree<V> ) existingNode.value;
+            dupsTree = ( AvlTreeImpl<V> ) existingNode.value;
         }
         else
         {
-            dupsTree = new AvlTree<V>( valueComparator );
+            dupsTree = new AvlTreeImpl<V>( valueComparator );
             dupsTree.insert( ( V ) existingNode.value );
             existingNode.value = dupsTree;
         }
@@ -293,9 +293,9 @@
         // check if the value matches
         if( value != null )
         {
-            if( temp.value instanceof AvlTree )
+            if( temp.value instanceof AvlTreeImpl )
             {
-                AvlTree<V> dupsTree = ( AvlTree<V> ) temp.value;
+                AvlTreeImpl<V> dupsTree = ( AvlTreeImpl<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 AvlTree )
+        if( node.value instanceof AvlTreeImpl )
         {
-            AvlTree<V> dupsTree = ( AvlTree<V> ) node.value;
+            AvlTreeImpl<V> dupsTree = ( AvlTreeImpl<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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -35,7 +35,7 @@
  * @version $Rev$, $Date$
  */
 @SuppressWarnings("unchecked")
-public class AvlTreeMarshaller<E> implements Marshaller<AvlTree<E>>
+public class AvlTreeMarshaller<E> implements Marshaller<AvlTreeImpl<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( AvlTree<E> tree )
+    public byte[] serialize( AvlTreeImpl<E> tree )
     {
         if( tree.isEmpty() )
         {
@@ -162,7 +162,7 @@
      * 
      * @param data byte array to be converted into AVLTree  
      */
-    public AvlTree<E> deserialize( byte[] data ) throws IOException
+    public AvlTreeImpl<E> deserialize( byte[] data ) throws IOException
     {
         if ( data == null || data.length == 0 )
         {
@@ -171,7 +171,7 @@
 
         if ( data.length == 1 && data[0] == 0 )
         {
-            return new AvlTree<E>( comparator );
+            return new AvlTreeImpl<E>( comparator );
         }
 
         ByteArrayInputStream bin = new ByteArrayInputStream( data );
@@ -189,7 +189,7 @@
         LinkedAvlNode[] nodes = new LinkedAvlNode[ size ];
         LinkedAvlNode<E> root = readTree( din, null, nodes );
         
-        AvlTree<E> tree = new AvlTree<E>( comparator );
+        AvlTreeImpl<E> tree = new AvlTreeImpl<E>( comparator );
         
         tree.setRoot( root );
         

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=761218&r1=761217&r2=761218&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 09:42:01 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.AvlTree;
+import org.apache.directory.server.core.avltree.AvlTreeImpl;
 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( AvlTree<V> avlTree, K key )
+    public KeyTupleAvlCursor( AvlTreeImpl<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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -39,7 +39,7 @@
     @Test
     public void testEmptyCursor() throws Exception
     {
-        AvlTree<Integer> tree = new AvlTree<Integer>( new IntegerComparator()
);
+        AvlTreeImpl<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
     {
-        AvlTree<Integer> tree = new AvlTree<Integer>( new IntegerComparator()
);
+        AvlTreeImpl<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
     {
-        AvlTree<Integer> tree = new AvlTree<Integer>( new IntegerComparator()
);
+        AvlTreeImpl<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/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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -189,9 +189,9 @@
         LinkedAvlMapNode node = tree.find( 3 );
         assertNotNull( node );
      
-        assertTrue( node.value.getClass() ==  AvlTree.class );
+        assertTrue( node.value.getClass() ==  AvlTreeImpl.class );
         
-        AvlTree dupsTree = ( AvlTree ) node.value;
+        AvlTreeImpl dupsTree = ( AvlTreeImpl ) 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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -87,11 +87,11 @@
 //        0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0 
 //    };
 
-    AvlTree<Integer> tree;
+    AvlTreeImpl<Integer> tree;
     Comparator<Integer> comparator;
     AvlTreeMarshaller<Integer> treeMarshaller;
     
-    static AvlTree<Integer> savedTree;
+    static AvlTreeImpl<Integer> savedTree;
     
     static File treeFile = new File( System.getProperty( "java.io.tmpdir" ) + File.separator
+ "avl.tree");
     
@@ -110,7 +110,7 @@
         };
         
       
-        tree = new AvlTree<Integer>( comparator );
+        tree = new AvlTreeImpl<Integer>( comparator );
         treeMarshaller = new AvlTreeMarshaller<Integer>( comparator, new IntegerKeyMarshaller()
);
     }
 
@@ -140,7 +140,7 @@
          */
 
         AvlTreeMarshaller<Long> treeMarshaller = new AvlTreeMarshaller<Long>(
comparator, new LongMarshaller() );
-        AvlTree<Long> tree = treeMarshaller.deserialize( SERIALIZED_AVLTREE_PRE_REMOVE
);
+        AvlTreeImpl<Long> tree = treeMarshaller.deserialize( SERIALIZED_AVLTREE_PRE_REMOVE
);
         
         for ( long key : AVLTREE_KEYS_PRE_REMOVE )
         {
@@ -164,8 +164,8 @@
     @Test
     public void testMarshalEmptyTree() throws IOException
     {
-        byte[] bites = treeMarshaller.serialize( new AvlTree<Integer>( comparator )
);
-        AvlTree<Integer> tree = treeMarshaller.deserialize( bites );
+        byte[] bites = treeMarshaller.serialize( new AvlTreeImpl<Integer>( comparator
) );
+        AvlTreeImpl<Integer> tree = treeMarshaller.deserialize( bites );
         assertNotNull( tree );
     }
 
@@ -173,9 +173,9 @@
     @Test
     public void testRoundTripEmpty() throws IOException
     {
-        AvlTree<Integer> original = new AvlTree<Integer>( comparator );
+        AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator
);
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertTrue( deserialized.isEmpty() );
     }
 
@@ -183,10 +183,10 @@
     @Test
     public void testRoundTripOneEntry() throws IOException
     {
-        AvlTree<Integer> original = new AvlTree<Integer>( comparator );
+        AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator
);
         original.insert( 0 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 1, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -196,10 +196,10 @@
     @Test
     public void testRoundTripOneEntryFirstLast() throws IOException
     {
-        AvlTree<Integer> original = new AvlTree<Integer>( comparator );
+        AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator
);
         original.insert( 0 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 1, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -222,11 +222,11 @@
     @Test
     public void testRoundTripTwoEntries() throws IOException
     {
-        AvlTree<Integer> original = new AvlTree<Integer>( comparator );
+        AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator
);
         original.insert( 0 );
         original.insert( 1 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 2, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -237,11 +237,11 @@
     @Test
     public void testRoundTripTwoEntriesFirstLast() throws IOException
     {
-        AvlTree<Integer> original = new AvlTree<Integer>( comparator );
+        AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator
);
         original.insert( 0 );
         original.insert( 1 );
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 2, deserialized.getSize() );
         assertEquals( 0, ( int ) deserialized.getFirst().getKey() );
@@ -265,13 +265,13 @@
     @Test
     public void testRoundTripManyEntries() throws Exception
     {
-        AvlTree<Integer> original = new AvlTree<Integer>( comparator );
+        AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator
);
         for ( int ii = 0; ii < 100; ii++ )
         {
             original.insert( ii );
         }
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 100, deserialized.getSize() );
 
@@ -288,13 +288,13 @@
     @Test
     public void testRoundTripManyEntriesFirstLast() throws Exception
     {
-        AvlTree<Integer> original = new AvlTree<Integer>( comparator );
+        AvlTreeImpl<Integer> original = new AvlTreeImpl<Integer>( comparator
);
         for ( int ii = 0; ii < 100; ii++ )
         {
             original.insert( ii );
         }
         byte[] bites = treeMarshaller.serialize( original );
-        AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
+        AvlTreeImpl<Integer> deserialized = treeMarshaller.deserialize( bites );
         assertFalse( deserialized.isEmpty() );
         assertEquals( 100, deserialized.getSize() );
 
@@ -331,7 +331,7 @@
             }
         };
 
-        AvlTree<Bar> original = new AvlTree<Bar>( barComparator );
+        AvlTreeImpl<Bar> original = new AvlTreeImpl<Bar>( barComparator );
 
         for ( int ii = 0; ii < 100; ii++ )
         {
@@ -340,7 +340,7 @@
 
         AvlTreeMarshaller<Bar> marshaller = new AvlTreeMarshaller<Bar>( barComparator
);
         byte[] bites = marshaller.serialize( original );
-        AvlTree<Bar> deserialized = marshaller.deserialize( bites );
+        AvlTreeImpl<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 );
         
-        AvlTree<Integer> unmarshalledTree = treeMarshaller.deserialize( data );
+        AvlTreeImpl<Integer> unmarshalledTree = treeMarshaller.deserialize( data );
         
         if( LOG.isDebugEnabled() )
         {

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreePerfTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreePerfTest.java?rev=761218&r1=761217&r2=761218&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreePerfTest.java
(original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreePerfTest.java
Thu Apr  2 09:42:01 2009
@@ -45,7 +45,7 @@
  */
 public class AvlTreePerfTest
 {
-    AvlTree<Integer> tree;
+    AvlTreeImpl<Integer> tree;
     
     static String tempDir = System.getProperty( "java.io.tmpdir" );
    
@@ -74,7 +74,7 @@
     @Before
     public void createTree()
     {
-      tree = new AvlTree<Integer>( new Comparator<Integer>() 
+      tree = new AvlTreeImpl<Integer>( new Comparator<Integer>() 
           {
 
             public int compare( Integer i1, Integer i2 )
@@ -296,7 +296,7 @@
         start = System.nanoTime();
         
         fin.read(data);
-        tree = (AvlTree<Integer>) treeMarshaller.deserialize( data );
+        tree = (AvlTreeImpl<Integer>) treeMarshaller.deserialize( data );
         
         end = System.nanoTime();
         LOG.info("total time taken for reconstructing a serialized AVLTree ->" + getTime(
start, end ) );

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java?rev=761218&r1=761217&r2=761218&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
(original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
Thu Apr  2 09:42:01 2009
@@ -43,14 +43,14 @@
 public class AvlTreeTest
 {
 
-    AvlTree<Integer> tree;
+    AvlTreeImpl<Integer> tree;
 
     private static final Logger LOG = LoggerFactory.getLogger( AvlTreeTest.class );
     
     @Before
     public void createTree()
     {
-      tree = new AvlTree<Integer>( new Comparator<Integer>() 
+      tree = new AvlTreeImpl<Integer>( new Comparator<Integer>() 
           {
 
             public int compare( Integer i1, Integer i2 )

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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.apache.directory.server.core.avltree.AvlTree;
+import org.apache.directory.server.core.avltree.AvlTreeImpl;
 
 
 /**
@@ -34,11 +34,11 @@
  */
 public class DupsContainer<V>
 {
-    private final AvlTree<V> avlTree;
+    private final AvlTreeImpl<V> avlTree;
     private final BTreeRedirect btreeRedirect;
 
 
-    DupsContainer( AvlTree<V> avlTree )
+    DupsContainer( AvlTreeImpl<V> avlTree )
     {
         this.avlTree = avlTree;
         btreeRedirect = null;
@@ -64,7 +64,7 @@
     }
 
 
-    final AvlTree<V> getAvlTree()
+    final AvlTreeImpl<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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -22,7 +22,7 @@
 
 import jdbm.btree.BTree;
 
-import org.apache.directory.server.core.avltree.AvlTree;
+import org.apache.directory.server.core.avltree.AvlTreeImpl;
 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() )
             {
-                AvlTree<V> set = values.getAvlTree();
+                AvlTreeImpl<V> set = values.getAvlTree();
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -189,7 +189,7 @@
 
             if ( values.isAvlTree() )
             {
-                AvlTree<V> set = values.getAvlTree();
+                AvlTreeImpl<V> set = values.getAvlTree();
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -302,7 +302,7 @@
 
             if ( values.isAvlTree() )
             {
-                AvlTree<V> set = values.getAvlTree();
+                AvlTreeImpl<V> set = values.getAvlTree();
                 dupsCursor = new AvlTreeCursor<V>( set );
             }
             else
@@ -357,7 +357,7 @@
 
                 if ( values.isAvlTree() )
                 {
-                    AvlTree<V> set = values.getAvlTree();
+                    AvlTreeImpl<V> set = values.getAvlTree();
                     dupsCursor = new AvlTreeCursor<V>( set );
                 }
                 else
@@ -408,7 +408,7 @@
 
                 if ( values.isAvlTree() )
                 {
-                    AvlTree<V> set = values.getAvlTree();
+                    AvlTreeImpl<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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -366,7 +366,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
+            AvlTreeImpl<V> set = values.getAvlTree();
 
             if ( set.getFirst() == null )
             {
@@ -405,7 +405,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
+            AvlTreeImpl<V> set = values.getAvlTree();
             LinkedAvlNode<V> result = set.findGreaterOrEqual( val );
             return result != null;
         }
@@ -436,7 +436,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
+            AvlTreeImpl<V> set = values.getAvlTree();
             LinkedAvlNode<V> result = set.findLessOrEqual( val );
             return result != null;
         }
@@ -587,7 +587,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
+            AvlTreeImpl<V> set = values.getAvlTree();
             replaced = set.insert( value );
             
             if ( replaced != null )// if the value already present returns the same value
@@ -650,7 +650,7 @@
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         if ( values.isAvlTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
+            AvlTreeImpl<V> set = values.getAvlTree();
 
             // If removal succeeds then remove if set is empty else replace it
             if ( set.remove( value ) != null )
@@ -680,7 +680,7 @@
              */
             if ( tree.size() <= numDupLimit )
             {
-                AvlTree<V> avlTree = convertToAvlTree( tree );
+                AvlTreeImpl<V> avlTree = convertToAvlTree( tree );
                 bt.insert( key, marshaller.serialize( avlTree ), true );
                 recMan.delete( tree.getRecid() );
             }
@@ -724,7 +724,7 @@
         }
         else
         {
-            AvlTree<V> set = marshaller.deserialize( serialized );
+            AvlTreeImpl<V> set = marshaller.deserialize( serialized );
             this.count -= set.getSize();
             return;
         }
@@ -769,7 +769,7 @@
             return new KeyTupleBTreeCursor<K,V>( tree, key, valueComparator );
         }
 
-        AvlTree<V> set = marshaller.deserialize( serialized );
+        AvlTreeImpl<V> set = marshaller.deserialize( serialized );
         return new KeyTupleAvlCursor<K,V>( set, key );
     }
 
@@ -831,7 +831,7 @@
     }
 
     
-    public Marshaller<AvlTree<V>> getMarshaller()
+    public Marshaller<AvlTreeImpl<V>> getMarshaller()
     {
         return marshaller;
     }
@@ -846,7 +846,7 @@
     {
         if ( serialized == null )
         {
-            return new DupsContainer<V>( new AvlTree<V>( valueComparator ) );
+            return new DupsContainer<V>( new AvlTreeImpl<V>( valueComparator
) );
         }
 
         if ( BTreeRedirectMarshaller.isRedirect( serialized ) )
@@ -931,9 +931,9 @@
 
 
     @SuppressWarnings("unchecked")
-    private AvlTree<V> convertToAvlTree( BTree bTree ) throws IOException
+    private AvlTreeImpl<V> convertToAvlTree( BTree bTree ) throws IOException
     {
-        AvlTree<V> avlTree = new AvlTree<V>( valueComparator );
+        AvlTreeImpl<V> avlTree = new AvlTreeImpl<V>( valueComparator );
         TupleBrowser browser = bTree.browse();
         jdbm.helper.Tuple tuple = new jdbm.helper.Tuple();
         while ( browser.getNext( tuple ) )
@@ -945,7 +945,7 @@
     }
     
 
-    private BTree convertToBTree( AvlTree<V> avlTree ) throws Exception
+    private BTree convertToBTree( AvlTreeImpl<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=761218&r1=761217&r2=761218&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 09:42:01 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.AvlTree;
+import org.apache.directory.server.core.avltree.AvlTreeImpl;
 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( AvlTree<V> avlTree, K key )
+    public KeyTupleAvlCursor( AvlTreeImpl<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=761218&r1=761217&r2=761218&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 09:42:01 2009
@@ -24,7 +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;
 import org.junit.Before;
@@ -40,7 +40,7 @@
 public class KeyTupleAvlCursorTest
 {
 
-    AvlTree<Integer> tree;
+    AvlTreeImpl<Integer> tree;
     Comparator<Integer> comparator;
     KeyTupleAvlCursor<Integer, Integer> cursor;
     
@@ -59,7 +59,7 @@
         
         };
         
-      tree = new AvlTree<Integer>( comparator );  
+      tree = new AvlTreeImpl<Integer>( comparator );  
       
       cursor = new KeyTupleAvlCursor<Integer, Integer>( tree, KEY );
     }



Mime
View raw message