org.objectweb.medor.lib

Class BasicTupleStructure

Implemented Interfaces:
Cloneable, TupleStructure
Known Direct Subclasses:
BasicJormExtent, BasicMultivaluedField, BasicQueryTree, MedorTCQueryLeaf

public class BasicTupleStructure
extends BasicCloneable
implements TupleStructure

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

Field Summary

protected ArrayList
fields
protected Logger
logger
protected HashMap
name2field

Constructor Summary

BasicTupleStructure()
BasicTupleStructure(Field[] fields)

Method Summary

Object
clone(Object clone, Map obj2clone)
boolean
contains(String fieldName)
Checks whether the current TupleStructure has a field of a given name.
boolean
contains(Field f)
Checks whether a given input Field is present in the current TupleStructure.
Field
getField(String fieldname)
Returns a Field object present in this TupleStructure given its name.
Field
getField(int fieldrank)
Returns the Field of a given rank in the current TupleStructure.
int
getFieldRank(Field f)
Returns the rank of a given Field in the current TupleStructure.
Field[]
getFields()
Returns the array of Fields in the current TupleStructure.
int
getSize()
Returns the size of the current TupleStructure, ie the number of Fields.

Field Details

fields

protected ArrayList fields


logger

protected Logger logger


name2field

protected HashMap name2field

Constructor Details

BasicTupleStructure

protected BasicTupleStructure()


BasicTupleStructure

public BasicTupleStructure(Field[] fields)
            throws MedorException

Method Details

clone

public Object clone(Object clone,
                    Map obj2clone)
            throws CloneNotSupportedException


contains

public boolean contains(String fieldName)
Checks whether the current TupleStructure has a field of a given name.
Specified by:
contains in interface TupleStructure

Parameters:
fieldName - the Field name for which to check whether the current TupleStructure contains a Field.

Returns:
true if the current TupleStructure contains a Field of the input name, false otherwise.


contains

public boolean contains(Field f)
Checks whether a given input Field is present in the current TupleStructure.
Specified by:
contains in interface TupleStructure

Parameters:
f - the Field for which to check whether it is present in the current TupleStructure.

Returns:
true if the Field is part of the current TupleStructure, false otherwise.


getField

public Field getField(String fieldname)
            throws MedorException
Returns a Field object present in this TupleStructure given its name.
Specified by:
getField in interface TupleStructure

Parameters:
fieldname - the name of the searched Field

Returns:
the Field in the current TupleStructure which has the input name.

Throws:
MedorException - if no Field corresponds to the input name.


getField

public Field getField(int fieldrank)
            throws MedorException
Returns the Field of a given rank in the current TupleStructure.
Specified by:
getField in interface TupleStructure

Parameters:
fieldrank - the rank of the searched Field in the current TupleStructure

Returns:
the Field in the current TupleStructure corresponding to the input rank.

Throws:
MedorException - if the input rank is too large.


getFieldRank

public int getFieldRank(Field f)
            throws MedorException
Returns the rank of a given Field in the current TupleStructure.
Specified by:
getFieldRank in interface TupleStructure

Parameters:
f - the Field for which the rank is searched.

Returns:
the rank of the input Field in the current TupleStructure.

Throws:
MedorException - if there is no such Field in the current TupleStructure.


getFields

public Field[] getFields()
Returns the array of Fields in the current TupleStructure.
Specified by:
getFields in interface TupleStructure

Returns:
the array of Fields in the current TupleStructure.


getSize

public int getSize()
Returns the size of the current TupleStructure, ie the number of Fields.
Specified by:
getSize in interface TupleStructure

Returns:
the number of Fields in the current TupleStructure.