KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mckoi > database > InternalTableInfo


1 /**
2  * com.mckoi.database.InternalTableInfo 23 Mar 2002
3  *
4  * Mckoi SQL Database ( http://www.mckoi.com/database )
5  * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * Version 2 as published by the Free Software Foundation.
10  *
11  * This program 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
14  * GNU General Public License Version 2 for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * Version 2 along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  * Change Log:
21  *
22  *
23  */

24
25 package com.mckoi.database;
26
27 import java.util.ArrayList JavaDoc;
28
29 /**
30  * A class that acts as a container for any system tables that are generated
31  * from information inside the database engine. For example, the database
32  * statistics table is an internal system table, as well as the table that
33  * describes all database table information, etc.
34  * <p>
35  * This object acts as a container and factory for generating such tables.
36  * <p>
37  * Note that implementations of this object should be thread-safe and
38  * immutable so we can create static global implementations.
39  *
40  * @author Tobias Downer
41  */

42
43 interface InternalTableInfo {
44
45   /**
46    * Returns the number of internal table sources that this object is
47    * maintaining.
48    */

49   int getTableCount();
50
51   /**
52    * Finds the index in this container of the given table name, otherwise
53    * returns -1.
54    */

55   int findTableName(TableName name);
56
57   /**
58    * Returns the name of the table at the given index in this container.
59    */

60   TableName getTableName(int i);
61
62   /**
63    * Returns the DataTableDef object that describes the table at the given
64    * index in this container.
65    */

66   DataTableDef getDataTableDef(int i);
67
68   /**
69    * Returns true if this container contains a table with the given name.
70    */

71   boolean containsTableName(TableName name);
72
73   /**
74    * Returns a String that describes the type of the table at the given index.
75    */

76   String JavaDoc getTableType(int i);
77   
78   /**
79    * This is the factory method for generating the internal table for the
80    * given table in this container. This should return an implementation of
81    * MutableTableDataSource that is used to represent the internal data being
82    * modelled.
83    * <p>
84    * This method is allowed to throw an exception for table objects that aren't
85    * backed by a MutableTableDataSource, such as a view.
86    */

87   MutableTableDataSource createInternalTable(int index);
88
89 }
90
Popular Tags