KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > mapper > rdb > lib > RdbIntermediaryTuple


1 /**
2  * Speedo: an implementation of JDO compliant personality on top of JORM generic
3  * I/O sub-system.
4  * Copyright (C) 2001-2004 France Telecom R&D
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  *
21  *
22  * Contact: speedo@objectweb.org
23  *
24  */

25
26 package org.objectweb.jorm.mapper.rdb.lib;
27
28 import java.math.BigDecimal JavaDoc;
29 import java.math.BigInteger JavaDoc;
30 import java.util.ArrayList JavaDoc;
31 import java.util.Date JavaDoc;
32
33 import org.objectweb.medor.api.MedorException;
34 import org.objectweb.medor.expression.api.Operand;
35 import org.objectweb.medor.tuple.api.Tuple;
36 import org.objectweb.medor.tuple.api.TupleCollection;
37
38 /**
39  * @author Y.Bersihand
40  */

41 public class RdbIntermediaryTuple implements Tuple {
42
43     private int[] associationTable;
44     private Tuple delegatePbTuple = null;
45     
46     public RdbIntermediaryTuple(int[] associationTable, Tuple delegatePbTuple) {
47         this.associationTable = associationTable;
48         this.delegatePbTuple = delegatePbTuple;
49     }
50     
51     public int getSize() {
52         return associationTable.length;
53     }
54
55     public Operand[] toOperandArray() {
56         return null;
57     }
58
59     public boolean getBoolean(int index) throws MedorException {
60         return delegatePbTuple.getBoolean(associationTable[index-1] + 1);
61     }
62
63     public byte getByte(int index) throws MedorException {
64         return delegatePbTuple.getByte(associationTable[index-1] + 1);
65     }
66
67     public byte[] getByteArray(int index) throws MedorException {
68         return delegatePbTuple.getByteArray(associationTable[index-1] + 1);
69     }
70
71     
72     public char getChar(int index) throws MedorException {
73         return delegatePbTuple.getChar(associationTable[index-1] + 1);
74     }
75
76     public char[] getCharArray(int index) throws MedorException {
77         return delegatePbTuple.getCharArray(associationTable[index-1] + 1);
78     }
79
80     public Date JavaDoc getDate(int index) throws MedorException {
81         return delegatePbTuple.getDate(associationTable[index-1] + 1);
82     }
83
84     public double getDouble(int index) throws MedorException {
85         return delegatePbTuple.getDouble(associationTable[index-1] + 1);
86     }
87
88     public float getFloat(int index) throws MedorException {
89         return delegatePbTuple.getFloat(associationTable[index-1] + 1);
90     }
91
92     public int getInt(int index) throws MedorException {
93         return delegatePbTuple.getInt(associationTable[index-1] + 1);
94     }
95
96     public Operand getLikeOperand(int index) throws MedorException {
97         return null;
98     }
99
100     public long getLong(int index) throws MedorException {
101         return delegatePbTuple.getLong(associationTable[index-1] + 1);
102     }
103
104     public Object JavaDoc getObject(int index) throws MedorException {
105         return delegatePbTuple.getObject(associationTable[index-1] + 1);
106     }
107
108     public short getShort(int index) throws MedorException {
109         return delegatePbTuple.getShort(associationTable[index-1] + 1);
110     }
111
112     public BigDecimal JavaDoc getBigDecimal(int index) throws MedorException {
113         return delegatePbTuple.getBigDecimal(associationTable[index-1] + 1);
114     }
115
116     public BigInteger JavaDoc getBigInteger(int index) throws MedorException {
117         return delegatePbTuple.getBigInteger(associationTable[index-1] + 1);
118     }
119
120     public String JavaDoc getString(int index) throws MedorException {
121         return delegatePbTuple.getString(associationTable[index-1] + 1);
122     }
123
124
125     public TupleCollection getTupleCollection(int index) throws MedorException {
126         // TODO Auto-generated method stub
127
return null;
128     }
129
130     public boolean isDefined(int index) {
131         return delegatePbTuple.isDefined(associationTable[index-1] + 1);
132     }
133
134 }
135
Popular Tags