Statistics
| Revision:

root / trunk / libraries / libGDBMS / src / main / java / com / hardcode / gdbms / engine / data / driver / ReadAccess.java @ 10627

History | View | Annotate | Download (2.08 KB)

1
package com.hardcode.gdbms.engine.data.driver;
2

    
3
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
4
import com.hardcode.gdbms.engine.values.Value;
5

    
6

    
7
/**
8
 * Interfaz que define los m?todos de acceso de lectura
9
 *
10
 * @author Fernando Gonz?lez Cort?s
11
 */
12
public interface ReadAccess {
13
        public final static int FIELD_TYPE_BOOLEAN = 0;
14
        public final static int FIELD_TYPE_STRING = 5;
15
        public final static int FIELD_TYPE_DOUBLE = 4;
16
        public final static int FIELD_TYPE_FLOAT = 3;
17
        public final static int FIELD_TYPE_LONGINT = 2;
18
        public final static int FIELD_TYPE_INT = 1;
19

    
20
        /**
21
         * Obtiene el valor que se encuentra en la fila y columna indicada
22
         *
23
         * @param rowIndex fila
24
         * @param fieldId columna
25
         *
26
         * @return subclase de Value con el valor del origen de datos. Never null (use 
27
     * ValueFactory.createNullValue() instead)
28
         * @throws ReadDriverException TODO
29
         */
30
        public abstract Value getFieldValue(long rowIndex, int fieldId)
31
                throws ReadDriverException;
32

    
33
        /**
34
         * Obtiene el n?mero de campos del DataSource
35
         *
36
         * @return
37
         * @throws ReadDriverException TODO
38
         */
39
        public abstract int getFieldCount() throws ReadDriverException;
40

    
41
        /**
42
         * Devuelve el nombre del campo fieldId-?simo
43
         *
44
         * @param fieldId ?ndice del campo cuyo nombre se quiere obtener
45
         *
46
         * @return
47
         * @throws ReadDriverException TODO
48
         */
49
        public abstract String getFieldName(int fieldId) throws ReadDriverException;
50

    
51
        /**
52
         * Obtiene el n?mero de registros del DataSource
53
         *
54
         * @return
55
         * @throws ReadDriverException TODO
56
         */
57
        public abstract long getRowCount() throws ReadDriverException;
58

    
59
        /**
60
         * Devuelve el tipo del campo i?simo. Devuelve una constante de la clase
61
         * java.sql.Types
62
         *
63
         * @param i ?ndice del campo cuyo tipo se quiere conocer
64
         *
65
         * @return Class
66
         * @throws ReadDriverException TODO
67
         */
68
        public abstract int getFieldType(int i) throws ReadDriverException;
69
        
70
        /**
71
         * Devuelve el ancho del campo i?simo.
72
         *
73
         * @param i ?ndice del campo cuyo ancho se quiere conocer
74
         *
75
         * @return int
76
         * @throws ReadDriverException TODO
77
         */
78
        public abstract int getFieldWidth(int i) throws ReadDriverException;
79
}