1 24 25 package com.mckoi.database; 26 27 36 37 abstract class AbstractInternalTableInfo implements InternalTableInfo { 38 39 42 private TableName[] table_list; 43 44 48 private DataTableDef[] table_def_list; 49 50 53 private String table_type; 54 55 59 AbstractInternalTableInfo(String type, DataTableDef[] table_def_list) { 60 this.table_def_list = table_def_list; 61 this.table_type = type; 62 table_list = new TableName[table_def_list.length]; 63 for (int i = 0; i < table_list.length; ++i) { 64 table_list[i] = table_def_list[i].getTableName(); 65 } 66 } 67 68 72 public int getTableCount() { 73 return table_list.length; 74 } 75 76 80 public int findTableName(TableName name) { 81 for (int i = 0; i < table_list.length; ++i) { 82 if (table_list[i].equals(name)) { 83 return i; 84 } 85 } 86 return -1; 87 } 88 89 92 public TableName getTableName(int i) { 93 return table_list[i]; 94 } 95 96 100 public DataTableDef getDataTableDef(int i) { 101 return table_def_list[i]; 102 } 103 104 107 public boolean containsTableName(TableName name) { 108 return findTableName(name) != -1; 109 } 110 111 114 public String getTableType(int i) { 115 return table_type; 116 } 117 118 } 119 120 | Popular Tags |