org.objectweb.medor.api

Interface TupleStructure

All Superinterfaces:
Cloneable
Known Subinterfaces:
MultivaluedField, NestedField
Known Implementing Classes:
AggregateRdbQueryNode, BasicJormExtent, BasicMultivaluedField, BasicNestedField, BasicQueryNode, BasicQueryTree, BasicRdbExpQueryLeaf, BasicRdbQueryLeaf, BasicRdbStringQueryLeaf, BasicTupleStructure, Cartesian, ClassExtent, GenClassExtent, Intersection, JoinProject, MedorTCQueryLeaf, Nest, Project, SelectProject, Union, Unnest

public interface TupleStructure
extends Cloneable

A TupleStructure is the basic data structure manipulated when expressing, optimizing and evaluating MEDOR queries.

A TupleStructure is composed of typed, named fields.

Field names are unique within a given TupleStructure.

Author:
Sebastien Chassande-Barrioz

See Also:
Field

Method Summary

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.

Methods inherited from interface org.objectweb.medor.api.Cloneable

clone

Method Details

contains

public boolean contains(String fieldName)
Checks whether the current TupleStructure has a field of a given name.

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.

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.

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.

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.

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.

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.

Returns:
the number of Fields in the current TupleStructure.