OSDN Git Service

imported from subversion repository
[xerial/xerial-core.git] / src / main / java / org / xerial / lens / relation / query / AmoebaJoinHandler.java
1 /*--------------------------------------------------------------------------\r
2  *  Copyright 2009 Taro L. Saito\r
3  *\r
4  *  Licensed under the Apache License, Version 2.0 (the "License");\r
5  *  you may not use this file except in compliance with the License.\r
6  *  You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  *  Unless required by applicable law or agreed to in writing, software\r
11  *  distributed under the License is distributed on an "AS IS" BASIS,\r
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  *  See the License for the specific language governing permissions and\r
14  *  limitations under the License.\r
15  *--------------------------------------------------------------------------*/\r
16 //--------------------------------------\r
17 // XerialJ\r
18 //\r
19 // RelationEventHandler.java\r
20 // Since: May 14, 2009 12:39:42 PM\r
21 //\r
22 // $URL: http://www.xerial.org/svn/project/XerialJ/trunk/xerial-core/src/main/java/org/xerial/lens/relation/query/AmoebaJoinHandler.java $\r
23 // $Author: leo $\r
24 //--------------------------------------\r
25 package org.xerial.lens.relation.query;\r
26 \r
27 import org.xerial.lens.relation.Node;\r
28 import org.xerial.lens.relation.schema.Schema;\r
29 \r
30 /**\r
31  * Interface of the amoeba join result handler. The tree data will be consumed\r
32  * in the depth-first manner, and newly found amoeba pair and tree nodes will be\r
33  * reported in the DFS order.\r
34  * \r
35  * @author leo\r
36  * \r
37  */\r
38 public interface AmoebaJoinHandler {\r
39 \r
40     /**\r
41      * This method will be invoked once before the amoeba join process starts\r
42      */\r
43     public void init();\r
44 \r
45     /**\r
46      * Invoked when a new amoeba node pair specified in the query set is found\r
47      * \r
48      * @param schema\r
49      * @param coreNode\r
50      * @param attributeNode\r
51      * @throws Exception\r
52      */\r
53     public void newAmoeba(Schema schema, Node coreNode, Node attributeNode) throws Exception;\r
54 \r
55     /**\r
56      * Invoked when leaving a node\r
57      * \r
58      * @param schema\r
59      * @param node\r
60      * @throws Exception\r
61      */\r
62     public void leaveNode(Schema schema, Node node) throws Exception;\r
63 \r
64     /**\r
65      * Invoked when a text node belongs to a core node is found\r
66      * \r
67      * @param schema\r
68      * @param coreNode\r
69      * @param textNode\r
70      *            text node may not contain a text value\r
71      * @param text\r
72      *            text fragment data of the text node\r
73      * @throws Exception\r
74      */\r
75     public void text(Schema schema, Node coreNode, Node textNode, String text) throws Exception;\r
76 \r
77     /**\r
78      * Invoked when reading the input stream has finished\r
79      */\r
80     public void finish();\r
81 }\r