KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > tuple > api > TupleLoader


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.tuple.api;
25
26 import org.objectweb.medor.api.MedorException;
27 import org.objectweb.medor.api.TupleStructure;
28 import org.objectweb.medor.expression.api.ParameterOperand;
29 import org.objectweb.medor.expression.api.ExpressionException;
30 import org.objectweb.medor.expression.api.VariableOperand;
31
32 /**
33  * This interface
34  */

35 public interface TupleLoader {
36
37     /**
38      * Loads a source Tuple into an array of Operands.
39      * The Tuple represents the concatenation of the Tuples from the children
40      * nodes of the associated QueryNode.
41      * LoadTuple is used after the filter has been sucessfully evaluated to
42      * load the current tuple (Tuple) into the memory tuple of this node,
43      * represented as an array of Operands.
44      * Not all attributes of the source Tuple are loaded into the array of
45      * Operand. The choice of which attributes to load is done either
46      * by using the array of indexes, which can be set through the setIndexes
47      * method, or because the instance of TupleLoader has been compiled for
48      * a particular QueryNode for which the indexes are known, and the
49      * implementation of loadTuple does the right selection amongst the
50      * Tuple attributes.
51      * @param source The source tuple to be loaded
52      * @param destination The array of VariableOperands into which the Tuple
53      * will be loaded
54      * @param parameters The array of input ParameterOperands.
55      */

56     void loadTuple(Tuple source, VariableOperand[] destination,
57                           ParameterOperand[] parameters)
58             throws MedorException, ExpressionException;
59
60     /**
61      * An integer with position i in this array gives the position of the
62      * corresponding field (field number i of the TupleStructure of this
63      * QueryNode) in the array made of the concatenation of the array of fields
64      * from all children of this QueryNode.
65      */

66     int[] getFieldIndexes();
67
68     TupleStructure getTupleStructure();
69 }
70
Popular Tags