Modifier and Type | Field and Description |
---|---|
protected boolean |
finished |
protected java.lang.String |
name |
protected java.util.LinkedList<SubTableSchema> |
subtables |
protected java.util.LinkedList<TableSchema> |
tableSchemas |
Modifier | Constructor and Description |
---|---|
protected |
Schema(java.lang.String name)
This constructor is used for the incremental construction of dbase or
oodb Schemas.
|
Modifier and Type | Method and Description |
---|---|
void |
add(SubTableSchema... sts)
add subtableschema in bulk
|
void |
add(SubTableSchema sts)
add subtable schema sts to 'this' database schema
|
void |
add(TableSchema... schemas)
for adding schemas in bulk
|
void |
add(TableSchema tableschema)
add table schema tableschema to 'this' database schema
|
void |
addIdentifiersToAllNonSubtables()
add identifier 'id' to all tables that are not subtables in 'this'
DBSchema do this prior to calling finish methods
|
static void |
basicVerification(Schema dbs,
java.util.List<java.lang.String> tableNames,
ErrorReport er) |
void |
copyFrom(Schema s)
copyFrom core elements of a database or oodb schema
|
boolean |
equals(Schema schema)
two Schemas are equal iff (a) they have the same set of table schemas,
and (b) they have the same set of subtableschemas; if so true is
returned.
|
void |
equalsEH(Schema schema)
two DBSchemas are equal iff (a) they have the same SubTableSchema, (b)
they have the same set of table schemas, and (c) they have the same set
of subtable schemas; if so this method returns.
|
DBSchema |
finishedAndIPropagatedAttributesMyself()
you finish a schema where you swear that you propagated all attributes in
a table hierarchy.
|
abstract java.lang.String |
getFullName()
full (file) SubTableSchema of a schema is (SubTableSchema).schema.pl
|
java.lang.String |
getName() |
SubTableSchema |
getSubTableSchema(java.lang.String tableName)
returns subtable object for given tableName, null if none exists
|
SubTableSchema |
getSubTableSchema(TableSchema ts)
returns subtable object for given tableSchema ts, null if none exists
|
SubTableSchema |
getSubTableSchemaEH(java.lang.String tableName)
returns subtable object for given tableName; throws Error if no such
tableName exists
|
SubTableSchema |
getSubTableSchemaEH(TableSchema ts)
returns subtable object for given tableSchema ts; throws Error if no such
ts exists
|
java.util.List<SubTableSchema> |
getSubTableSchemas()
return list of SubTableSchemas of this database schema
|
TableSchema |
getSuperTable(TableSchema s)
return the TableSchema of the super/belongsToSchema table of TableSchema
s
|
TableSchema |
getTableSchema(java.lang.String tableName)
return the TableSchema with SubTableSchema tableName
|
TableSchema |
getTableSchemaEH(java.lang.String tableName)
return the TableSchema with SubTableSchema tableName with built-in error
handling
|
java.util.List<TableSchema> |
getTableSchemas()
return list of TableSchemas of this database schema
|
boolean |
isFinished() |
boolean |
isGEQ(java.lang.String supTable,
java.lang.String subTable) |
boolean |
isGEQ(TableSchema sup,
TableSchema sub) |
void |
print()
prints to System.out
|
void |
print(java.io.PrintStream out)
print the database schema definition to PrintStream out; typically used
for demonstrations as it doesn't check the format of the filename; Use
print() or print(String).
|
abstract void |
print(java.lang.String filename)
general print to file method
calls print(filename,requiredFileEnding) utility method below
|
protected void |
print(java.lang.String filename,
java.lang.String RequiredFileEnding)
print DBSchema in file with filename
|
void |
rename(java.lang.String name)
rename Schema
|
protected java.lang.String |
SchemaDeclString(java.lang.String whichToken) |
int |
size()
return number of TableSchemas (equivalently the number of Tables in a
schema instance) in this dbschema
|
abstract java.lang.String |
toString() |
protected java.lang.String |
toString(java.lang.String whichToken) |
protected java.lang.String name
protected final java.util.LinkedList<TableSchema> tableSchemas
protected java.util.LinkedList<SubTableSchema> subtables
protected boolean finished
protected Schema(java.lang.String name)
name
- -- name given to schemapublic abstract java.lang.String getFullName()
public int size()
public void copyFrom(Schema s)
s
- -- copy TableSchemas and SubTables from s into 'this'public java.lang.String getName()
public void rename(java.lang.String name)
name
- new Schema Namepublic boolean isFinished()
public static void basicVerification(Schema dbs, java.util.List<java.lang.String> tableNames, ErrorReport er) throws java.lang.RuntimeException
java.lang.RuntimeException
public boolean equals(Schema schema)
schema
- -- the other schemapublic void equalsEH(Schema schema)
schema.
- public void add(TableSchema tableschema)
tableschema
- to add to 'this' database schemapublic void add(TableSchema... schemas)
schemas
- -- list of table schemaspublic void add(SubTableSchema sts)
sts
- subtableschema to add to 'this' databasepublic void add(SubTableSchema... sts)
sts
- -- an array of subtable schemaspublic SubTableSchema getSubTableSchema(java.lang.String tableName)
tableName
- -- SubTableSchema of table whose subtables are to be
returnedpublic SubTableSchema getSubTableSchema(TableSchema ts)
ts
- -- TableSchema object for which subtable declaration is to be
returnedpublic SubTableSchema getSubTableSchemaEH(java.lang.String tableName)
tableName
- -- SubTableSchema of table whose subtables are to be
returnedpublic SubTableSchema getSubTableSchemaEH(TableSchema ts)
ts
- -- SubTableSchema of tableSchema whose subtables are to be
returnedpublic java.util.List<SubTableSchema> getSubTableSchemas()
public TableSchema getSuperTable(TableSchema s)
s
- -- input TableSchemapublic TableSchema getTableSchema(java.lang.String tableName)
tableName
- of schema to returnpublic TableSchema getTableSchemaEH(java.lang.String tableName)
tableName
- of schema to returnpublic java.util.List<TableSchema> getTableSchemas()
public boolean isGEQ(java.lang.String supTable, java.lang.String subTable)
supTable
- -- name of super tablesubTable
- -- name of subtablepublic boolean isGEQ(TableSchema sup, TableSchema sub)
sup
- -- TableSchema of super tablesub
- -- TableSchema of subtablepublic void print()
public void print(java.io.PrintStream out)
out
- PrintStream destinationpublic abstract void print(java.lang.String filename)
filename
- -- where to print schemaprotected void print(java.lang.String filename, java.lang.String RequiredFileEnding)
filename
- -- name of file in which to print DBSchemaRequiredFileEnding
- -- files to be written must have this extensionprotected java.lang.String SchemaDeclString(java.lang.String whichToken)
public abstract java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String toString(java.lang.String whichToken)
public void addIdentifiersToAllNonSubtables()
public DBSchema finishedAndIPropagatedAttributesMyself()