KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > datasystem > persistentsystem > Table


1 package com.daffodilwoods.daffodildb.server.datasystem.persistentsystem;
2
3 import com.daffodilwoods.daffodildb.server.datasystem.interfaces.*;
4 import com.daffodilwoods.daffodildb.server.datasystem.utility.*;
5 import com.daffodilwoods.database.resource.DException;
6 import com.daffodilwoods.database.general.QualifiedIdentifier;
7 import com.daffodilwoods.daffodildb.server.sql99.utils._Reference;
8
9 /**
10  *It is above in the hierarchy of all tables and persists the table below in the hierarchy, From this
11  *Table number of Iterators can be taken to perform operations on table.
12
13  */

14 public class Table implements _DataTable{
15
16     /**
17      * Table below in hierarchy to Perform operations of read and write
18      */

19
20    public _TableList table;
21
22
23    private QualifiedIdentifier tableName;
24
25    /**
26     * to get DatabaseUserTable
27     */

28    private PersistentDatabase persistentDatabase;
29
30    public Table(QualifiedIdentifier tableName0,PersistentDatabase persistentDatabase0,_TableList table0) {
31       persistentDatabase = persistentDatabase0;
32       table = table0;
33       tableName = tableName0;
34    }
35
36    /**
37     * returns Iterator to navigate on Table
38     *
39     * @return Iterator to navigate on Table
40     */

41
42    public _TableIterator getIterator() throws DException {
43         return new DatabaseUserTableIterator(persistentDatabase.getDatabaseUserTable(tableName,table),((PersistentTable)table.getTable(5)).getClusterIterator());
44    }
45
46    public _TableCharacteristics getTableCharacteristics() throws DException{
47        return table.getTableCharacteristics();
48    }
49
50
51    public int getIndexType() throws DException {
52       return 1;
53    }
54
55
56    public _Record getBlankRecord() throws DException{
57       _TableCharacteristics tc = table.getTableCharacteristics();
58       return new Record(tc,new Object JavaDoc[tc.getColumnCount()]);
59    }
60
61
62    public void rollBack() throws DException {
63      table.rollBack();
64   }
65
66   /* writen by kuldeep and used in test cases TestFreeClusterList related */
67   public _TableList getTable() {
68     return table;
69   }
70
71 }
72
73
Popular Tags