|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.database.global.ColumnDescription
public class ColumnDescription
This is a description of a column and the data it stores. Specifically it stores the 'type' as defined in the Types class, the 'size' if the column cells may be different lengths (eg, string), the name of the column, whether the column set must contain unique elements, and whether a cell may be added that is null.
Constructor Summary | |
---|---|
ColumnDescription(ColumnDescription cd)
|
|
ColumnDescription(java.lang.String name,
ColumnDescription cd)
|
|
ColumnDescription(java.lang.String name,
int type,
boolean not_null)
|
|
ColumnDescription(java.lang.String name,
int type,
int size,
boolean not_null)
The Constructors if the type does require a size. |
Method Summary | |
---|---|
java.lang.Class |
classType()
Returns the class of Java object for this field. |
boolean |
equals(java.lang.Object ob)
The 'equals' method, used to determine equality between column descriptions. |
java.lang.String |
getName()
Returns the name of the field. |
int |
getScale()
If this is a number, returns the scale of the field. |
int |
getSize()
Returns the size of the given field. |
int |
getSQLType()
Returns a value from java.sql.Type that is the SQL type defined for this column. |
java.lang.String |
getSQLTypeName()
Returns the name (as a string) of the SQL type or null if the type is not understood. |
int |
getType()
Returns an integer representing the type of the field. |
int |
getUniqueGroup()
Returns the unique group that this column is in. |
boolean |
isNotNull()
Determines whether the field can contain a null value or not. |
boolean |
isNumericType()
Returns true if this column is a numeric type. |
boolean |
isQuantifiable()
Returns true if the type of the field is searchable. |
boolean |
isUnique()
Determines whether the field can contain two items that are identical. |
static ColumnDescription |
readFrom(java.io.DataInputStream in)
Reads a ColumnDescription from the given DataInputStream and returns a new instance of it. |
void |
setScale(int scale)
Sets the scale of the numerical values stored. |
void |
setSQLType(int sql_type)
Sets the SQL type for this ColumnDescription object. |
void |
setUnique()
Sets this column to unique. |
void |
setUniqueGroup(int group)
Sets the column to belong to the specified unique group in the table. |
void |
writeTo(java.io.DataOutputStream out)
Writes this ColumnDescription to the given DataOutputStream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColumnDescription(java.lang.String name, int type, int size, boolean not_null)
public ColumnDescription(java.lang.String name, int type, boolean not_null)
public ColumnDescription(ColumnDescription cd)
public ColumnDescription(java.lang.String name, ColumnDescription cd)
Method Detail |
---|
public void setUnique()
public void setUniqueGroup(int group)
public void setSQLType(int sql_type)
DB_STRING := CHAR, VARCHAR, LONGVARCHAR DB_NUMERIC := TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL DB_DATE := DATE, TIME, TIMESTAMP DB_BOOLEAN := BIT DB_BLOB := BINARY, VARBINARY, LONGVARBINARY DB_OBJECT := JAVA_OBJECT
public void setScale(int scale)
public java.lang.String getName()
public int getType()
public boolean isNumericType()
public int getSQLType()
public java.lang.String getSQLTypeName()
public java.lang.Class classType()
public int getSize()
public int getScale()
public boolean isNotNull()
public boolean isUnique()
public int getUniqueGroup()
public boolean isQuantifiable()
public boolean equals(java.lang.Object ob)
equals
in class java.lang.Object
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
java.io.IOException
public static ColumnDescription readFrom(java.io.DataInputStream in) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |