KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > filter > api > ExpressionHelper


1 /**
2  * MEDOR: Middleware Enabling Distributed Object Requests
3  *
4  * Copyright (C) 2001-2003 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.filter.api;
25
26 import org.objectweb.medor.expression.api.ExpressionException;
27 import org.objectweb.medor.api.MedorException;
28 import org.objectweb.medor.expression.api.TypingException;
29 import org.objectweb.medor.expression.api.ParameterOperand;
30 import org.objectweb.medor.expression.api.Expression;
31 import org.objectweb.medor.expression.api.Operand;
32 import org.objectweb.medor.query.api.QueryNode;
33 import org.objectweb.medor.tuple.api.Tuple;
34
35 /**
36  *
37  * @author Sebastien Chassande-Barrioz
38  */

39 public interface ExpressionHelper {
40
41     Expression[] toStack(Expression e)
42             throws ExpressionException, TypingException;
43
44     Expression join(Expression[] es)
45             throws ExpressionException, TypingException;
46
47     Operand evaluate(Expression[] stack, ParameterOperand[] parameters,
48                             Tuple t)
49             throws MedorException, ExpressionException, IllegalStateException JavaDoc;
50
51     Expression substituteParameters(ParameterOperand[] pos,
52                                            Expression e)
53             throws ExpressionException, TypingException;
54
55     Expression[] substituteParameters(ParameterOperand[] pos,
56                                              Expression[] e)
57             throws ExpressionException, TypingException;
58
59     String JavaDoc[] getParameterNames(Expression e) throws ExpressionException,
60             TypingException;
61
62     /**
63      * For a given Expression used at a QueryNode, sets the index of its
64      * FieldOperands (index in the tuple resulting from the concatenation
65      * of the children QueryNode tuples).
66      * It will call the setIndex method of
67      * <a HREF="FieldOperand.html">FieldOperand</a>.
68      * @param node: the QueryNode to which the Expression is attached
69      * @param e: the Expression to be visited for setting the index of its
70      * FieldOperands.
71      * @see org.objectweb.medor.filter.api.FieldOperand
72      */

73     void fixIndexes(QueryNode node, Expression e);
74 }
75
Popular Tags