|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjimm.datavision.source.Column
public class Column
Represents a data column. Not all data sources' columns will be
contained within tables. For those that don't, their columns'
getTable method will return null.
Table,
DataSource| Field Summary | |
|---|---|
protected java.lang.String |
dateParseFormat
|
static java.lang.String |
DEFAULT_DATE_PARSE_FORMAT
|
protected java.lang.Object |
id
|
protected java.lang.String |
name
|
protected int |
type
|
| Constructor Summary | |
|---|---|
Column(java.lang.Object id,
java.lang.String name,
int type)
|
|
| Method Summary | |
|---|---|
java.lang.String |
dragString()
Returns the string used to identify the object when dragging it. |
boolean |
equals(java.lang.Object obj)
Returns true if the other object is a column with the
same id. |
java.lang.String |
fieldTypeString()
Returns the string used to create a field of the appropriate type. |
java.lang.String |
fullName()
Returns the full named of this column: the id as a string. |
java.lang.String |
getDateParseFormat()
Returns the date parse format, useful for data sources that read text strings and convert them into date objects. |
java.lang.String |
getDisplayName()
|
java.lang.Object |
getId()
Returns the table id. |
java.lang.String |
getName()
Returns the column's name. |
java.lang.String |
getSelectString(SQLQuery query)
Returns the string used by a SQL query to select this object. |
java.lang.String |
getSortString(SQLQuery query)
Returns the string used as the name/value of this selectable in a SQL ORDER BY clause. |
Table |
getTable()
Returns the table to which this column belongs, if any. |
int |
getType()
Returns the type constant (a java.sql.Types value). |
java.lang.Object |
getValue(Report report)
Returns the current value. |
int |
hashCode()
|
boolean |
isDate()
Returns true if this column is some date type. |
boolean |
isNumeric()
Returns true if this column is some numeric type
(double, int, etc.) |
boolean |
isString()
Returns true if this column is some character type. |
Selectable |
reloadInstance(DataSource dataSource)
Returns a (possibly new) instance of this selectable object. |
void |
setDateParseFormat(java.lang.String format)
Sets the date parse format, useful for data sources that read text strings and convert them into date objects. |
void |
setName(java.lang.String name)
A column's name is immutable. |
java.lang.String |
toString()
Returns a string representation of this column. |
static int |
typeFromString(java.lang.String str)
|
static java.lang.String |
typeToString(int type)
|
void |
writeXML(XMLWriter out)
Writes this object as an XML tag. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_DATE_PARSE_FORMAT
protected java.lang.Object id
protected java.lang.String name
protected int type
protected java.lang.String dateParseFormat
| Constructor Detail |
|---|
public Column(java.lang.Object id,
java.lang.String name,
int type)
| Method Detail |
|---|
public static int typeFromString(java.lang.String str)
public static java.lang.String typeToString(int type)
public boolean equals(java.lang.Object obj)
true if the other object is a column with the
same id.
equals in class java.lang.Objectobj - any Object
true if the other object is a column with the
same id.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object getId()
getId in interface IdentitygetId in interface Selectablepublic java.lang.String getName()
fullName.
getName in interface NameablefullName()public void setName(java.lang.String name)
setName in interface Nameablename - the new namepublic java.lang.String getDateParseFormat()
DEFAULT_DATE_PARSE_FORMAT
DEFAULT_DATE_PARSE_FORMAT)public void setDateParseFormat(java.lang.String format)
ReportReader.column, for example.
format - the date parse format stringpublic Table getTable()
getTable in interface Selectablenull if there is nonepublic java.lang.String fullName()
For SQL columns, this is a string of the form "table_name.column_name".
To retrieve just the column name, use getName.
getName()public int getType()
java.sql.Types value).
java.sql.Types valueTypespublic java.lang.Object getValue(Report report)
Selectable
getValue in interface Selectablereport - a report
public java.lang.String fieldTypeString()
Selectable
fieldTypeString in interface SelectableField.createField.create(java.lang.Long, jimm.datavision.Report, jimm.datavision.Section, java.lang.String, java.lang.Object, boolean)public java.lang.String getSelectString(SQLQuery query)
Selectable
getSelectString in interface Selectablepublic java.lang.String getSortString(SQLQuery query)
SelectablegetSelectString.
getSortString in interface SelectableSelectable.getSelectString(jimm.datavision.source.sql.SQLQuery)public java.lang.String dragString()
Draggable
dragString in interface Draggablepublic java.lang.String getDisplayName()
getDisplayName in interface Selectablepublic Selectable reloadInstance(DataSource dataSource)
Selectable
reloadInstance in interface Selectablepublic boolean isNumeric()
true if this column is some numeric type
(double, int, etc.)
true if this column is some numeric type
(double, int, etc.)public boolean isDate()
true if this column is some date type.
true if this column is some date typepublic boolean isString()
true if this column is some character type.
true if this column is some character typepublic java.lang.String toString()
fullName.
toString in class java.lang.ObjectfullName()public void writeXML(XMLWriter out)
Writeable
writeXML in interface Writeableout - a writer that knows how to write XML
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||