|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jimm.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.Object
obj
- any Object
true
if the other object is a column with the
same id.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object getId()
getId
in interface Identity
getId
in interface Selectable
public java.lang.String getName()
fullName
.
getName
in interface Nameable
fullName()
public void setName(java.lang.String name)
setName
in interface Nameable
name
- 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 Selectable
null
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
valueTypes
public java.lang.Object getValue(Report report)
Selectable
getValue
in interface Selectable
report
- a report
public java.lang.String fieldTypeString()
Selectable
fieldTypeString
in interface Selectable
Field.create
Field.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 Selectable
public java.lang.String getSortString(SQLQuery query)
Selectable
getSelectString
.
getSortString
in interface Selectable
Selectable.getSelectString(jimm.datavision.source.sql.SQLQuery)
public java.lang.String dragString()
Draggable
dragString
in interface Draggable
public java.lang.String getDisplayName()
getDisplayName
in interface Selectable
public Selectable reloadInstance(DataSource dataSource)
Selectable
reloadInstance
in interface Selectable
public 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.Object
fullName()
public void writeXML(XMLWriter out)
Writeable
writeXML
in interface Writeable
out
- a writer that knows how to write XML
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |