KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * com.mckoi.database.RawDiagnosticTable 29 Nov 2000
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 /**
28  * An interface that allows for the inspection and repair of the raw data
29  * in a file. This is used for table debugging and the repair of damaged
30  * files.
31  *
32  * @author Tobias Downer
33  */

34
35 public interface RawDiagnosticTable {
36
37   /**
38    * Statics that represent the various states of a record.
39    */

40   public final static int UNCOMMITTED = 1,
41                           COMMITTED_ADDED = 2,
42                           COMMITTED_REMOVED = 3,
43                           DELETED = 4; // ie. available for reclaimation.
44

45   /**
46    * Denotes an erroneous record state.
47    */

48   public final static int RECORD_STATE_ERROR = 0;
49
50   // ---------- Query Methods ----------
51

52   /**
53    * Returns the number of physical records in the table. This includes
54    * records that are uncommitted, deleted, committed removed and committed
55    * added.
56    */

57   int physicalRecordCount();
58
59   /**
60    * Returns the DataTableDef object that describes the logical topology of
61    * the columns in this table.
62    */

63   DataTableDef getDataTableDef();
64
65   /**
66    * Returns the state of the given record index. The state of a row is
67    * either UNCOMMITTED, COMMITTED ADDED, COMMITTED REMOVED or DELETED.
68    * record_index should be between 0 and physicalRecordCount.
69    */

70   int recordState(int record_index);
71
72   /**
73    * The number of bytes the record takes up on the underlying media.
74    */

75   int recordSize(int record_index);
76
77   /**
78    * Returns the contents of the given cell in this table. If the system is
79    * unable to return a valid cell then an exception is thrown.
80    */

81   TObject getCellContents(int column, int record_index);
82
83   /**
84    * Returns any misc information regarding this row as a human readable
85    * string. May return null if there is no misc information associated with
86    * this record.
87    */

88   String JavaDoc recordMiscInformation(int record_index);
89
90 }
91
Popular Tags