KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > api > TupleStructure


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, S. Chassande-Barrioz
22  */

23
24 package org.objectweb.medor.api;
25
26 import org.objectweb.medor.clone.api.Cloneable;
27
28 /**
29  * A TupleStructure is the basic data structure manipulated when expressing,
30  * optimizing and evaluating MEDOR queries.
31  * <p>A TupleStructure is composed of typed, named fields.
32  * <p>Field names are unique within a given TupleStructure.
33  * @author Sebastien Chassande-Barrioz
34  * @see Field
35  */

36 public interface TupleStructure extends Cloneable JavaDoc {
37
38     /**
39      * Returns the array of Fields in the current TupleStructure.
40      * @return the array of Fields in the current TupleStructure.
41      */

42     Field[] getFields();
43
44     /**
45      * Returns a Field object present in this TupleStructure given its name.
46      * @param fieldname the name of the searched Field
47      * @return the Field in the current TupleStructure which has the input name.
48      * @throws MedorException if no Field corresponds to the input name.
49      */

50     Field getField(String JavaDoc fieldname) throws MedorException;
51
52     /**
53      * Returns the Field of a given rank in the current TupleStructure.
54      * @param fieldrank the rank of the searched Field in the current
55      * TupleStructure
56      * @return the Field in the current TupleStructure corresponding to the
57      * input rank.
58      * @throws MedorException if the input rank is too large.
59      */

60     Field getField(int fieldrank) throws MedorException;
61
62     /**
63      * Returns the rank of a given Field in the current TupleStructure.
64      * @param f the Field for which the rank is searched.
65      * @return the rank of the input Field in the current TupleStructure.
66      * @throws MedorException if there is no such Field in the current
67      * TupleStructure.
68      */

69     int getFieldRank(Field f) throws MedorException;
70
71     /**
72      * Returns the size of the current TupleStructure, ie the number of
73      * Fields.
74      * @return the number of Fields in the current TupleStructure.
75      */

76     int getSize();
77
78     /**
79      * Checks whether a given input Field is present in the current
80      * TupleStructure.
81      * @param f the Field for which to check whether it is present in the
82      * current TupleStructure.
83      * @return true if the Field is part of the current TupleStructure, false
84      * otherwise.
85      */

86     boolean contains(Field f);
87
88     /**
89      * Checks whether the current TupleStructure has a field of a given name.
90      * @param fieldName the Field name for which to check whether the current
91      * TupleStructure contains a Field.
92      * @return true if the current TupleStructure contains a Field of the input
93      * name, false otherwise.
94      */

95     boolean contains(String JavaDoc fieldName);
96 }
97
Popular Tags