OSDN Git Service

xerial-core-1.0.10
authorleo <leo@ae02f08e-27ec-0310-ae8c-8ba02fe2eafd>
Fri, 22 May 2009 06:32:43 +0000 (06:32 +0000)
committerleo <leo@ae02f08e-27ec-0310-ae8c-8ba02fe2eafd>
Fri, 22 May 2009 06:32:43 +0000 (06:32 +0000)
 * properly handled text elements

git-svn-id: http://www.xerial.org/svn/project/XerialJ/trunk/xerial-core@3335 ae02f08e-27ec-0310-ae8c-8ba02fe2eafd

pom.xml
src/main/java/org/xerial/relation/query/StreamAmoebaJoin.java

diff --git a/pom.xml b/pom.xml
index 48076e5..0b0be86 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
   <groupId>org.xerial</groupId>
   <artifactId>xerial-core</artifactId>
   <name>Xerial Core</name>
-  <version>1.0.10-SNAPSHOT</version>
+  <version>1.0.10</version>
   <description>Xerial Core: standard utilities for XerialJ project</description>
 
   <build>
index 825f75a..6e41c46 100644 (file)
@@ -94,6 +94,8 @@ public class StreamAmoebaJoin implements TreeVisitor
     private HashMap<Edge, List<Operation>> operationSetOnBack = new HashMap<Edge, List<Operation>>();
     private HashMap<Edge, List<TextOperation>> operatSetOnText = new HashMap<Edge, List<TextOperation>>();
 
+    private int attributeAmoebaSize = 1;
+
     public StreamAmoebaJoin(QuerySet query, AmoebaJoinHandler handler) throws IOException
     {
         this.query = query;
@@ -151,7 +153,8 @@ public class StreamAmoebaJoin implements TreeVisitor
 
         public void execute(String nodeName, String textData) throws Exception
         {
-            for (Iterator<String> it = currentPath.descendingIterator(); it.hasNext();)
+            int hop = 0;
+            for (Iterator<String> it = currentPath.descendingIterator(); it.hasNext() && hop <= attributeAmoebaSize; hop++)
             {
                 String contextNode = it.next();
                 if (coreNode_action.containsKey(contextNode))
@@ -234,7 +237,8 @@ public class StreamAmoebaJoin implements TreeVisitor
 
         public void execute() throws Exception
         {
-            for (Iterator<String> it = currentPath.descendingIterator(); it.hasNext();)
+            int hop = 0;
+            for (Iterator<String> it = currentPath.descendingIterator(); it.hasNext() && hop <= attributeAmoebaSize; hop++)
             {
                 String contextNode = it.next();
                 if (coreNode_action.containsKey(contextNode))
@@ -244,8 +248,8 @@ public class StreamAmoebaJoin implements TreeVisitor
                 }
             }
 
-            throw new XerialError(XerialErrorCode.INVALID_STATE, String.format("no action is invoked: path=%s %s",
-                    currentPath, coreNode_action));
+            //            throw new XerialError(XerialErrorCode.INVALID_STATE, String.format("no action is invoked: path=%s %s",
+            //                    currentPath, coreNode_action));
         }
 
     }
@@ -266,7 +270,8 @@ public class StreamAmoebaJoin implements TreeVisitor
 
         public void execute() throws Exception
         {
-            for (Iterator<String> it = currentPath.descendingIterator(); it.hasNext();)
+            int hop = 0;
+            for (Iterator<String> it = currentPath.descendingIterator(); it.hasNext() && hop <= attributeAmoebaSize; hop++)
             {
                 String contextNode = it.next();
                 if (coreNode_action.containsKey(contextNode))
@@ -276,8 +281,8 @@ public class StreamAmoebaJoin implements TreeVisitor
                 }
             }
 
-            throw new XerialError(XerialErrorCode.INVALID_STATE, String.format("no action is invoked: path=%s %s",
-                    currentPath, coreNode_action));
+            //            throw new XerialError(XerialErrorCode.INVALID_STATE, String.format("no action is invoked: path=%s %s",
+            //                    currentPath, coreNode_action));
         }
 
     }