From b55c12bc757fae50d51724f85d9f45c9fdc2df23 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 22 May 2009 06:32:43 +0000 Subject: [PATCH] xerial-core-1.0.10 * 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 | 2 +- .../org/xerial/relation/query/StreamAmoebaJoin.java | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 48076e5..0b0be86 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.xerial xerial-core Xerial Core - 1.0.10-SNAPSHOT + 1.0.10 Xerial Core: standard utilities for XerialJ project diff --git a/src/main/java/org/xerial/relation/query/StreamAmoebaJoin.java b/src/main/java/org/xerial/relation/query/StreamAmoebaJoin.java index 825f75a..6e41c46 100644 --- a/src/main/java/org/xerial/relation/query/StreamAmoebaJoin.java +++ b/src/main/java/org/xerial/relation/query/StreamAmoebaJoin.java @@ -94,6 +94,8 @@ public class StreamAmoebaJoin implements TreeVisitor private HashMap> operationSetOnBack = new HashMap>(); private HashMap> operatSetOnText = new HashMap>(); + 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 it = currentPath.descendingIterator(); it.hasNext();) + int hop = 0; + for (Iterator 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 it = currentPath.descendingIterator(); it.hasNext();) + int hop = 0; + for (Iterator 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 it = currentPath.descendingIterator(); it.hasNext();) + int hop = 0; + for (Iterator 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)); } } -- 2.11.0