KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > query > api > QueryNode


1 /**
2  * MEDOR: Middleware Enabling Distributed Object Requests
3  *
4  * Copyright (C) 2001-2004 France Telecom R&D
5  * Contact: alexandre.lefebvre@rd.francetelecom.com
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  *
21  * Initial developers: M. Alia, A. Lefebvre
22  */

23
24 package org.objectweb.medor.query.api;
25
26 import org.objectweb.jorm.type.api.PType;
27 import org.objectweb.medor.api.MedorException;
28 import org.objectweb.medor.expression.api.Expression;
29 import org.objectweb.medor.tuple.api.TupleLoader;
30
31 /**
32  * @author Sebastien Chassande-Barrioz
33  */

34 public interface QueryNode extends FilteredQueryTree {
35
36     /**
37      * Creates and adds a PropagatedField to the TupleStructure of the
38      * QueryNode.
39      * @param name is the name of the Field to be added. If null, the name is
40      * computed from the origin Fields (parameter anc).
41      * @param type is the PType of the Field to be added. If null, the type is
42      * computed from the origin Fields (parameter anc).
43      * @param anc are the origin Fields for the PropagatedField to be created.
44      * @return the newly created PropagatedField
45      * @throws MedorException when a Field with the same name already exists.
46      */

47     PropagatedField addPropagatedField(String JavaDoc name, PType type,
48                                       QueryTreeField[] anc)
49         throws MedorException;
50
51     /**
52      * Creates and adds a CalculatedField to the TupleStructure of the
53      * QueryNode.
54      * @param name is the name of the Field to be added.
55      * @param type is the PType of the Field to be added.
56      * @param exp is the Expression for calculating the new Field.
57      * @return the newly created CalculatedField
58      * @throws MedorException when a Field with the same name already exists.
59      */

60     CalculatedField addCalculatedField(String JavaDoc name, PType type,
61                                       Expression exp)
62         throws MedorException;
63
64     /**
65      * Removes a Field.
66      * @param name is the name of the Field to be removed.
67      * @return the Field which has been removed, or null if no such Field could
68      * be removed.
69      * @throws MedorException when no Field with such name exist.
70      */

71     QueryTreeField removeField(String JavaDoc name)
72         throws MedorException;
73
74     /**
75      * It retreives the array of the QueryTree used by this QueryNode.
76      */

77     QueryTree[] getChildren();
78
79     /**
80      * Indicates whether a row of nulls should be inserted for the
81      * given child if the filter condition fails for all rows in
82      * that child.
83      **/

84     boolean isOuter(QueryTree child);
85
86     void setOuter(QueryTree child, boolean outer);
87
88     /**
89      * It retrieves the operation type of the current QueryNode.
90      */

91     short getType();
92
93     /**
94      * An integer with position i in this array gives the position of the
95      * corresponding field (field number i of the TupleStructure of this
96      * QueryNode) in the array made of the concatenation of the array of fields
97      * from all children of this QueryNode.
98      */

99     //int[] getFieldIndexes();
100

101     /**
102      * Returns the TupleLoader currently associated with this QueryNode.
103      * Note that TupleLoaders are only used at evaluation time.
104      */

105     TupleLoader getTupleLoader();
106
107     /**
108      * Associates a TupleLoader with this QueryNode.
109      */

110     void setTupleLoader(TupleLoader loader);
111
112     void updatePropagatedField(String JavaDoc name, QueryTreeField[] previous)
113         throws MedorException;
114
115     void updateCalculatedField(String JavaDoc name, Expression e) throws MedorException;
116
117     QueryTreeField replace(QueryTreeField old, QueryTreeField neo);
118 }
119
Popular Tags