org.objectweb.medor.tuple.lib

Class GeneralTupleLoader

Implemented Interfaces:
TupleLoader

public class GeneralTupleLoader
extends java.lang.Object
implements TupleLoader

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

Constructor Summary

GeneralTupleLoader(int[] ranges, TupleStructure ts)

Method Summary

int[]
getFieldIndexes()
An integer with position i in this array gives the position of the corresponding field (field number i of the TupleStructure of this QueryNode) in the array made of the concatenation of the array of fields from all children of this QueryNode.
TupleStructure
getTupleStructure()
void
loadTuple(Tuple sourceBuffer, VariableOperand[] temp, ParameterOperand[] parameters)
Loads a source Tuple into an array of Operands.
void
setFieldIndexes(int[] indexes)

Constructor Details

GeneralTupleLoader

public GeneralTupleLoader(int[] ranges,
                          TupleStructure ts)

Method Details

getFieldIndexes

public int[] getFieldIndexes()
An integer with position i in this array gives the position of the corresponding field (field number i of the TupleStructure of this QueryNode) in the array made of the concatenation of the array of fields from all children of this QueryNode.
Specified by:
getFieldIndexes in interface TupleLoader


getTupleStructure

public TupleStructure getTupleStructure()
Specified by:
getTupleStructure in interface TupleLoader


loadTuple

public void loadTuple(Tuple sourceBuffer,
                      VariableOperand[] temp,
                      ParameterOperand[] parameters)
            throws MedorException,
                   ExpressionException
Loads a source Tuple into an array of Operands. The Tuple represents the concatenation of the Tuples from the children nodes of the associated QueryNode. LoadTuple is used after the filter has been sucessfully evaluated to load the current tuple (Tuple) into the memory tuple of this node, represented as an array of Operands. Not all attributes of the source Tuple are loaded into the array of Operand. The choice of which attributes to load is done either by using the array of indexes, which can be set through the setIndexes method, or because the instance of TupleLoader has been compiled for a particular QueryNode for which the indexes are known, and the implementation of loadTuple does the right selection amongst the Tuple attributes.
Specified by:
loadTuple in interface TupleLoader

Parameters:
parameters - The array of input ParameterOperands.


setFieldIndexes

public void setFieldIndexes(int[] indexes)