|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.database.Table
public class Table
This class contains some static informations about a table, like name and size. It can sorted differently, either by name or size.
Constructor Summary | |
---|---|
Table(java.lang.String name)
initializes the object |
|
Table(java.lang.String name,
int size)
initializes the object |
Method Summary | |
---|---|
void |
assign(java.lang.Object o)
retrieves the inner state of the given object and updates its own state with those settings |
int |
compareTo(java.lang.Object o)
compares the given object to itself, depending on the sorting |
java.lang.String |
createForeignKeyStatement(Column localCol,
Table foreignTable,
Column foreignCol)
generates an SQL statement for adding a foreign key to this table. |
static java.lang.String |
createForeignKeyStatement(Table localTable,
Column localCol,
Table foreignTable,
Column foreignCol)
generates an SQL statement for adding a foreign key to this table. |
boolean |
equals(java.lang.Object obj)
checks whether the objects are the same |
java.lang.String |
getName()
returns the name of the table |
int |
getSize()
returns the size (in records) of the table |
boolean |
getSortByName()
returns whether the sorting is done by name (= TRUE) or by size (= FALSE) |
static void |
main(java.lang.String[] args)
for testing only |
void |
setSize(int size)
sets the size (in records) of the table |
void |
setSortByName(boolean sortByName)
sets whether the sorting is done by name (= TRUE) or by size (= FALSE) |
java.lang.String |
toString()
just returns the name of the table |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Table(java.lang.String name)
public Table(java.lang.String name, int size)
Method Detail |
---|
public java.lang.String getName()
public void setSize(int size)
public int getSize()
public void setSortByName(boolean sortByName)
public boolean getSortByName()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String createForeignKeyStatement(Column localCol, Table foreignTable, Column foreignCol)
localCol
- the local column that referencesforeignTable
- the foreign table the key is lcoated inforeignCol
- the column in the foreign table
public static java.lang.String createForeignKeyStatement(Table localTable, Column localCol, Table foreignTable, Column foreignCol)
localTable
- the local table that references the foreign tablelocalCol
- the local column that referencesforeignTable
- the foreign table the key is lcoated inforeignCol
- the column in the foreign table
public void assign(java.lang.Object o)
assign
in interface Assignable
o
- the object to retrieve the inner state frompublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |