|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.database.Column
public class Column
This class contains some static informations about a column, like name and type.
Types
Constructor Summary | |
---|---|
Column(java.lang.String name)
initializes the column |
|
Column(java.lang.String name,
int type)
initializes the column |
|
Column(java.lang.String name,
int type,
int size)
initializes the column |
|
Column(java.lang.String name,
int type,
java.lang.String typeName)
initializes the column |
|
Column(java.lang.String name,
int type,
java.lang.String typeName,
int size)
initializes the column |
Method Summary | |
---|---|
void |
assign(java.lang.Object o)
retrieves the inner state of the given object and updates its own state with those settings |
java.lang.Object |
clone()
returns a copy of itself |
int |
compareTo(java.lang.Object o)
compares the given object to itself |
boolean |
equals(java.lang.Object obj)
checks whether the objects are the same |
java.lang.String |
getName()
returns the name of the column |
int |
getSize()
returns the display size of the column |
java.lang.String |
getTable()
returns the name of the table this column is member of, can be null! |
int |
getType()
returns the type of the column |
java.lang.String |
getTypeName()
returns the type name (database specific) of the column |
boolean |
isBoolean()
checks whether the column is of boolean type, i.e. |
boolean |
isDate()
checks whether the column is date type, i.e. |
boolean |
isDecimal()
checks whether the column is a decimal type, i.e. |
boolean |
isInteger()
checks whether the column is an integer type, i.e. |
boolean |
isNominal()
checks whether the column is of nominal type, i.e. |
boolean |
isNumerical()
checks whether the value is either integer or float type |
static void |
main(java.lang.String[] args)
for testing only |
void |
setType(int type)
sets the type of the column |
void |
setTypeName(java.lang.String typeName)
sets the type name of the column (database specific) |
java.lang.String |
toString()
just returns the name of the table |
java.lang.String |
typeToString()
returns an SQL representation of the current type |
static java.lang.String |
typeToString(int type)
returns an SQL representation of the given type (very crude, only INT DOUBLE, DATE and VARCHAR(255) are returned), NULL if it cannot convert it |
static java.lang.String |
typeToString(int type,
int size)
returns an SQL representation of the given type (very crude, only INT DOUBLE, DATE, CHAR(size) and VARCHAR(size) are returned), NULL if it cannot convert it |
static java.lang.String |
typeToString(int type,
java.lang.String typeName,
int size)
returns an SQL representation of the given type (very crude, only INT DOUBLE, DATE, CHAR(size) and VARCHAR(size) are returned), NULL if it cannot convert it |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Column(java.lang.String name)
name
- the name of the columnpublic Column(java.lang.String name, int type)
name
- the name of the columntype
- the JDBC-type of the columnpublic Column(java.lang.String name, int type, int size)
name
- the name of the columntype
- the JDBC-type of the columnsize
- the "display" size of the type, -1 is uninitializedpublic Column(java.lang.String name, int type, java.lang.String typeName)
name
- the name of the columntype
- the JDBC-type of the columntypeName
- the database specific type namepublic Column(java.lang.String name, int type, java.lang.String typeName, int size)
name
- the name of the columntype
- the JDBC-type of the columntypeName
- the database specific type namesize
- the "display" size of the type, -1 is uninitializedMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getTable()
public java.lang.String getName()
public void setType(int type)
Types
public int getType()
Types
public void setTypeName(java.lang.String typeName)
public java.lang.String getTypeName()
public int getSize()
ResultSetMetaData.getColumnDisplaySize(int)
public java.lang.String typeToString()
typeToString(int, int)
public static java.lang.String typeToString(int type)
typeToString(int, int)
public static java.lang.String typeToString(int type, int size)
public static java.lang.String typeToString(int type, java.lang.String typeName, int size)
public boolean isNominal()
Types.CHAR
,
Types.VARCHAR
,
Types.LONGVARCHAR
public boolean isBoolean()
Types.BIT
,
Types.BOOLEAN
public boolean isInteger()
Types.INTEGER
,
Types.TINYINT
,
Types.SMALLINT
,
Types.BIGINT
public boolean isDecimal()
Types.NUMERIC
,
Types.REAL
,
Types.FLOAT
,
Types.DOUBLE
,
Types.DECIMAL
public boolean isNumerical()
isInteger()
,
isDecimal()
public boolean isDate()
Types.DATE
,
Types.TIMESTAMP
public void assign(java.lang.Object o)
assign
in interface Assignable
o
- the object to retrieve the inner state frompublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
java.lang.ClassCastException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public 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 |