directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r642509 - in /directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl: CursorBuilder.java EvaluatorBuilder.java ExpressionCursorBuilder.java ExpressionEvaluatorBuilder.java
Date Sat, 29 Mar 2008 05:44:16 GMT
Author: akarasulu
Date: Fri Mar 28 22:44:12 2008
New Revision: 642509

URL: http://svn.apache.org/viewvc?rev=642509&view=rev
Log:
Cleaning up useless Builder interfaces, and filling in EvaluatorBuilder with new
Evaluators created on last commit.

Added:
    directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
      - copied, changed from r642507, directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionCursorBuilder.java
    directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
      - copied, changed from r642507, directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionEvaluatorBuilder.java
Removed:
    directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionCursorBuilder.java
    directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionEvaluatorBuilder.java

Copied: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
(from r642507, directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionCursorBuilder.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java?p2=directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java&p1=directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionCursorBuilder.java&r1=642507&r2=642509&rev=642509&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionCursorBuilder.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
Fri Mar 28 22:44:12 2008
@@ -58,14 +58,14 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ExpressionCursorBuilder<E> implements CursorBuilder<E>
+public class CursorBuilder<E>
 {
     /** The database used by this enumerator */
     private Store<E> db = null;
     /** CursorBuilder flyweight for evaulating filter scope assertions */
     private ScopeCursorBuilder<E> scopeEnumerator;
-    /** Evaluator dependency on a ExpressionEvaluatorBuilder */
-    private ExpressionEvaluatorBuilder<Attributes> evaluatorBuilder;
+    /** Evaluator dependency on a EvaluatorBuilder */
+    private EvaluatorBuilder<Attributes> evaluatorBuilder;
 
 
     /**
@@ -74,8 +74,8 @@
      * @param db database used by this enumerator
      * @param evaluatorBuilder
      */
-    public ExpressionCursorBuilder(BTreePartition db, AttributeTypeRegistry attributeTypeRegistry,
-        ExpressionEvaluatorBuilder evaluatorBuilder )
+    public CursorBuilder(BTreePartition db, AttributeTypeRegistry attributeTypeRegistry,
+        EvaluatorBuilder evaluatorBuilder )
     {
         this.db = db;
         this.evaluatorBuilder = evaluatorBuilder;

Copied: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
(from r642507, directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionEvaluatorBuilder.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java?p2=directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java&p1=directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionEvaluatorBuilder.java&r1=642507&r2=642509&rev=642509&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ExpressionEvaluatorBuilder.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
Fri Mar 28 22:44:12 2008
@@ -37,7 +37,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ExpressionEvaluatorBuilder implements EvaluatorBuilder<Attributes>
+public class EvaluatorBuilder
 {
     private final Store<Attributes> db;
     private final Registries registries;
@@ -56,25 +56,19 @@
      * @param registries the schema registries
      * @throws Exception failure to access db or lookup schema in registries
      */
-    public ExpressionEvaluatorBuilder( Store<Attributes> db, Registries registries
) throws Exception
+    public EvaluatorBuilder( Store<Attributes> db, Registries registries ) throws Exception
     {
         this.db = db;
         this.registries = registries;
     }
 
 
-    // ------------------------------------------------------------------------
-    // EvaluatorBuilder.build() implementation
-    // ------------------------------------------------------------------------
-
-
-    /**
-     * @see EvaluatorBuilder#build(ExprNode)
-     */
     public Evaluator<? extends ExprNode, Attributes> build( ExprNode node ) throws
Exception
     {
         switch ( node.getAssertionType() )
         {
+                /* ---------- LEAF NODE HANDLING ---------- */
+
             case APPROXIMATE:
                 return new ApproximateEvaluator( ( ApproximateNode ) node, db, registries
);
             case EQUALITY:
@@ -96,7 +90,7 @@
             case AND:
                 return buildAndEvaluator( ( AndNode ) node );
             case NOT:
-                throw new NotImplementedException();
+                return new NotEvaluator( ( NotNode ) node, build( ( ( NotNode ) node).getFirstChild()
) );
             case OR:
                 return buildOrEvaluator( ( OrNode ) node );
 
@@ -109,46 +103,6 @@
             default:
                 throw new IllegalStateException( "Unknown assertion type: " + node.getAssertionType()
);
         }
-
-//        BranchNode bnode = ( BranchNode ) node;
-//
-//        if ( bnode instanceof OrNode )
-//        {
-//            for ( ExprNode child:bnode.getChildren() )
-//            {
-//                if ( evaluate( child, entry ) )
-//                {
-//                    return true;
-//                }
-//            }
-//
-//            return false;
-//        }
-//        else if ( bnode instanceof AndNode )
-//        {
-//            for ( ExprNode child:bnode.getChildren() )
-//            {
-//                if ( !evaluate( child, entry ) )
-//                {
-//                    return false;
-//                }
-//            }
-//
-//            return true;
-//        }
-//        else if ( bnode instanceof NotNode )
-//        {
-//            if ( null != bnode.getFirstChild() )
-//            {
-//                return !evaluate( bnode.getFirstChild(), entry );
-//            }
-//
-//            throw new NamingException( "Negation has no child: " + node );
-//        }
-//        else
-//        {
-//                throw new NamingException( "Unrecognized branch node operator: " + bnode
);
-//        }
     }
 
 



Mime
View raw message