directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r761254 - 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 11:35:19 GMT
Author: akarasulu
Date: Thu Apr  2 11:35:18 2009
New Revision: 761254

URL: http://svn.apache.org/viewvc?rev=761254&view=rev
Log:
extracting new interface from AvlTreeMapImpl called AvlTreeMap

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/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
    directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursor.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

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=761254&r1=761253&r2=761254&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 11:35:18 2009
@@ -24,6 +24,7 @@
 
 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.AvlTreeMapImpl;
 import org.apache.directory.server.core.avltree.AvlTreeMapNoDupsCursor;
 import org.apache.directory.server.core.avltree.KeyTupleAvlCursor;
@@ -43,7 +44,7 @@
  */
 public class AvlTable<K, V> implements Table<K, V>
 {
-    private final AvlTreeMapImpl<K, V> avl;
+    private final AvlTreeMap<K, V> avl;
     private final String name;
     private final Comparator<K> keyComparator;
     private final Comparator<V> valComparator;
@@ -449,7 +450,7 @@
      *
      * @return AvlTreeMap used to store Tuples
      */
-    AvlTreeMapImpl<K,V> getAvlTreeMap()
+    AvlTreeMap<K, V> getAvlTreeMap()
     {
         return avl;
     }

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java?rev=761254&r1=761253&r2=761254&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
(original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
Thu Apr  2 11:35:18 2009
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AvlTreeMapImpl<K,V>
+public class AvlTreeMapImpl<K,V> implements AvlTreeMap<K, V>
 {
     /** the root of the tree */
     private LinkedAvlMapNode<K,V> root;
@@ -73,8 +73,8 @@
     }
 
     
-    /**
-     * @return the key comparator associated with this tree 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#getKeyComparator()
      */
     public Comparator<K> getKeyComparator()
     {
@@ -82,8 +82,8 @@
     }
     
 
-    /**
-     * @return the value comparator associated with this tree 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#getValueComparator()
      */
     public Comparator<V> getValueComparator()
     {
@@ -91,13 +91,8 @@
     }
     
     
-    /**
-     * Inserts a LinkedAvlMapNode with the given key and value.
-     *
-     * @param key the item to be inserted
-     * @return the replaced key if it already exists
-     * TODO - should we not return the value if the key already existed?
-     * Note: Replaces a nodes value if duplicate keys are not allowed.
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#insert(K, V)
      */
     public K insert( K key, V value )
     {
@@ -265,13 +260,8 @@
     }
     
     
-    /**
-     * Removes the LinkedAvlMapNode present in the tree with the given key and value
-     *
-     * @param key the key of the node to be removed
-     * @param value the value of the node, if null the entire node will be removed 
-     *              including any values having the same key
-     * @return the removed key, if any, or null if the key does not exist
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#remove(K, V)
      */
     @SuppressWarnings("unchecked")
     public K remove( K key, V value )
@@ -462,10 +452,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.AvlTreeMap#isEmpty()
      */
     public boolean isEmpty()
     {
@@ -473,10 +461,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.AvlTreeMap#getSize()
      */
     //NOTE: This method is internally used by AVLTreeMarshaller
     public int getSize()
@@ -542,9 +528,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.AvlTreeMap#getRoot()
      */
     public LinkedAvlMapNode<K,V> getRoot()
     {
@@ -552,8 +537,8 @@
     }
     
     
-    /**
-     * @return a list of the stored keys in this tree
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#getKeys()
      */
     public List<K> getKeys()
     {
@@ -569,8 +554,8 @@
         return keys;
     }
 
-    /**
-     * Prints the contents of AVL tree in pretty format
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#printTree()
      */
     public void printTree() 
     {
@@ -590,8 +575,8 @@
     }
     
 
-    /**
-     * @return The first element of this tree
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#getFirst()
      */
     public LinkedAvlMapNode<K,V> getFirst()
     {
@@ -599,8 +584,8 @@
     }
 
     
-    /**
-     * @return The last element in this tree
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#getLast()
      */
     public LinkedAvlMapNode<K,V> getLast()
     {
@@ -772,12 +757,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlMapNode<K,V> whose key is higher than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlMapNode<K,V> 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.AvlTreeMap#findGreater(K)
      */
     public LinkedAvlMapNode<K,V> findGreater( K key )
     {
@@ -796,12 +777,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlMapNode<K,V> whose key is higher than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlMapNode<K,V> 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.AvlTreeMap#findGreaterOrEqual(K)
      */
     public LinkedAvlMapNode<K,V> findGreaterOrEqual( K key )
     {
@@ -820,12 +797,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlMapNode<K,V> whose key is lower than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlMapNode<K,V> 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.AvlTreeMap#findLess(K)
      */
     public LinkedAvlMapNode<K,V> findLess( K key )
     {
@@ -844,12 +817,8 @@
     }
 
 
-    /**
-     * Finds a LinkedAvlMapNode<K,V> whose key is lower than the given key.
-     *
-     * @param key the key
-     * @return the LinkedAvlMapNode<K,V> 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.AvlTreeMap#findLessOrEqual(K)
      */
     public LinkedAvlMapNode<K,V> findLessOrEqual( K key )
     {
@@ -897,12 +866,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.AvlTreeMap#find(K)
      */
     public LinkedAvlMapNode<K,V> find( K key )
     {
@@ -910,6 +875,9 @@
     }
     
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#find(K, V)
+     */
     @SuppressWarnings("unchecked")
     public LinkedAvlMapNode<K,V> find( K key, V value )
     {
@@ -1102,6 +1070,9 @@
     }
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.avltree.AvlTreeMap#isDupsAllowed()
+     */
     public boolean isDupsAllowed()
     {
         return allowDuplicates;

Modified: directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursor.java?rev=761254&r1=761253&r2=761254&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursor.java
(original)
+++ directory/apacheds/branches/ldif-partition/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursor.java
Thu Apr  2 11:35:18 2009
@@ -33,14 +33,14 @@
  */
 public class AvlTreeMapNoDupsCursor<K,V> extends AbstractTupleCursor<K,V>
 {
-    private AvlTreeMapImpl<K,V> tree;
+    private AvlTreeMap<K, V> tree;
     private LinkedAvlMapNode<K,V> node;
     private boolean onNode = false;
     private boolean isAfterLast = false;
     private boolean isBeforeFirst = true;
     private Tuple<K,V> returnedTuple = new Tuple<K,V>();
     
-    public AvlTreeMapNoDupsCursor( AvlTreeMapImpl<K,V> tree )
+    public AvlTreeMapNoDupsCursor( AvlTreeMap<K, V> tree )
     {
         this.tree = tree;
     }

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=761254&r1=761253&r2=761254&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 11:35:18 2009
@@ -43,7 +43,7 @@
  */
 public class AvlTreeMapNoDupsCursorTest
 {
-    AvlTreeMapImpl<Integer, Integer> tree;
+    AvlTreeMap<Integer, Integer> tree;
 
     AvlTreeMapNoDupsCursor<Integer, Integer> cursor;
 

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=761254&r1=761253&r2=761254&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 11:35:18 2009
@@ -45,7 +45,7 @@
 public class AvlTreeMapTest
 {
 
-    AvlTreeMapImpl<Integer, Integer> tree;
+    AvlTreeMap<Integer, Integer> tree;
 
     private static final Logger LOG = LoggerFactory.getLogger( AvlTreeTest.class );
 



Mime
View raw message