KickJava   Java API By Example, From Geeks To Geeks.

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


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.expression.api.Operand;
28
29 import java.util.Date JavaDoc;
30 import java.math.BigDecimal JavaDoc;
31 import java.math.BigInteger JavaDoc;
32
33 /**
34  * This interface represents a tuple like in database terminology.
35  * <p>
36  * It is a list of attributes. Each getXXX(attributeNum) method retrieves the
37  * value of
38  * an attribute into an XXX type if possible. Columns are numbered starting
39  * from 1.
40  * <p>Tuple extends the Cloneable
41  * interface to indicate to the Object.clone() method that it is legal for
42  * that method to make a field-for-field copy of instances of a tuple class.
43  */

44 public interface Tuple {
45
46     /**
47      * Give the number of the attribute in this Tuple object.
48      * @return an int
49      */

50     int getSize();
51
52     /**
53      * Give the array of Operand object representation of the Tuple.
54      * @return an array of Operand type.
55      */

56     Operand[] toOperandArray();
57
58     /**
59      * Returns the value of the designated column
60      * in the current row of this Tuple
61      * as a Boolean of java programming language
62      */

63     boolean getBoolean(int i) throws MedorException;
64
65     /**
66      * Returns the value of the designated column
67      * in the current row of this Tuple as a Java byte
68      */

69     byte getByte(int i) throws MedorException;
70
71     /**
72      * Returns the value of the designated column
73      * in the current row of this Tuple as a Java byte
74      */

75     byte[] getByteArray(int i) throws MedorException;
76
77     /**
78      * Returns the value of the designated column
79      * in the current row of this Tuple as a Java char
80      */

81     char getChar(int i) throws MedorException;
82
83     /**
84      * Returns the value of the designated column
85      * in the current row of this Tuple as a Java char[]
86      */

87     char[] getCharArray(int i) throws MedorException;
88
89     /**
90      * Returns the value of the designated column
91      * in the current row of this Tuple as a java.sql.Data
92      */

93     Date JavaDoc getDate(int i) throws MedorException;
94
95     /**
96      * Returns the value of the designated column
97      * in the current row of this Tuple as a Java double
98      */

99     double getDouble(int i) throws MedorException;
100
101     /**
102      * Returns the value of the designated column
103      * in the current row of this Tuple as a Java float
104      */

105     float getFloat(int i) throws MedorException;
106
107     /**
108      * Returns the value of the designated column
109      * in the current row of this Tuple as a java int
110      */

111     int getInt(int i) throws MedorException;
112
113     /**
114      * Returns the value of the designated column
115      * in the current row of this Tuple
116      * as an org.objectweb.medor.filter.Operand Object
117      */

118     Operand getLikeOperand(int i) throws MedorException;
119
120     /**
121      * Returns the value of the designated column
122      * in the current row of this Tuple as a Java long
123      */

124     long getLong(int i) throws MedorException;
125
126     /**
127      * Returns the value of the designated column
128      * in the current row of this Tuple as a Java Object
129      */

130     Object JavaDoc getObject(int i) throws MedorException;
131
132     /**
133      * Returns the value of the designated column
134      * in the current row of this Tuple
135      * as a Short in the java programming language
136      */

137     short getShort(int i) throws MedorException;
138
139     /**
140      * Returns the value of the designated column
141      * in the current row of this Tuple
142      * as a BigDecimal in the java programming language
143      */

144     BigDecimal JavaDoc getBigDecimal(int i) throws MedorException;
145
146     /**
147      * Returns the value of the designated column
148      * in the current row of this Tuple
149      * as a BigDecimal in the java programming language
150      */

151     BigInteger JavaDoc getBigInteger(int i) throws MedorException;
152
153     /**
154      * Returns the value of the designated column
155      * in the current row of this Tuple
156      * as a String in java programming language
157      */

158     String JavaDoc getString(int i) throws MedorException;
159
160     /**
161      * Returns the value of the designated column
162      * in the current row of this Tuple
163      * as a org.objectweb.medor object
164      */

165     TupleCollection getTupleCollection(int i) throws MedorException;
166
167     boolean isDefined(int i);
168 }
169
Popular Tags