|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.ed.inf.utils.database.TableColumn
public class TableColumn
A column object contains all the information to create, fill and delete a database table column
| Constructor Summary | |
|---|---|
TableColumn(java.lang.String columnName,
java.lang.String dataType,
boolean isKey)
Constructor 2: takes the column name, data type and primary key status |
|
| Method Summary | |
|---|---|
int |
compare(java.lang.Object f1,
java.lang.Object f2)
Compares two columns by their name, returns -1 if f1 comes alphabetically before f2, 0 if the two are equal and +1 if f2 comes alphabetically before f1. |
int |
compareTo(TableColumn f2)
Compares two columns by their name, returns -1 if this column comes alphabetically before f2, 0 if the two are equal and +1 if f2 comes alphabetically before this column. |
boolean |
equals(TableColumn anotherColumn)
Compares two columns by their name, returns true if the two columns have the same name, false otherwise. |
java.lang.String |
getColumnName()
Gets the column name |
java.lang.String |
getDataType()
Gets the column data type |
int |
getNoOfRows()
Gets the number of rows in the column |
boolean |
isPrimaryKey()
Gets the column primary key status |
void |
setIsPrimaryKey(boolean isKey)
Sets the column primary key status |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TableColumn(java.lang.String columnName,
java.lang.String dataType,
boolean isKey)
columnName - name of the columndataType - data type (e.g. varchar(25) )isKey - true if the column is a primary key| Method Detail |
|---|
public int compare(java.lang.Object f1,
java.lang.Object f2)
f1 - the first column to comparef2 - the second column to compare
public int compareTo(TableColumn f2)
compareTo in interface java.lang.Comparable<TableColumn>f2 - the second column to compare
public boolean equals(TableColumn anotherColumn)
anotherColumn - the second column to compare
public java.lang.String getColumnName()
public java.lang.String getDataType()
public int getNoOfRows()
public boolean isPrimaryKey()
public void setIsPrimaryKey(boolean isKey)
isKey - the primary key status, e.g. 'true'= is a primary key
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||