jimm.datavision
Interface Selectable

All Known Implementing Classes:
Column, NCColumn, SQLColumn, TestColumn, UserColumn

public interface Selectable

The Selectable interface represents things that can be selected, grouped, and sorted. This includes data columns and user columns.

Author:
Jim Menard, jimm@io.com
See Also:
Group, Query, DataSource

Method Summary
 java.lang.String fieldTypeString()
          Returns the string used to create a field of the appropriate type.
 java.lang.String getDisplayName()
           
 java.lang.Object getId()
          Returns the id of the selectable object.
 java.lang.String getSelectString(SQLQuery q)
          Returns the string used by a SQL query to select this object.
 java.lang.String getSortString(SQLQuery q)
          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 selectable belongs; may be null.
 java.lang.Object getValue(Report r)
          Returns the current value.
 Selectable reloadInstance(DataSource dataSource)
          Returns a (possibly new) instance of this selectable object.
 

Method Detail

getId

java.lang.Object getId()
Returns the id of the selectable object.

Returns:
the id of the selectable object

getValue

java.lang.Object getValue(Report r)
Returns the current value. May only be valid during a report run.

Parameters:
r - a report
Returns:
the current value

getSelectString

java.lang.String getSelectString(SQLQuery q)
Returns the string used by a SQL query to select this object.


getSortString

java.lang.String getSortString(SQLQuery q)
Returns the string used as the name/value of this selectable in a SQL ORDER BY clause. This may be the same as the select string returned by getSelectString.

Returns:
a string used when creating the ORDER BY clause
See Also:
getSelectString(jimm.datavision.source.sql.SQLQuery)

getTable

Table getTable()
Returns the table to which this selectable belongs; may be null.

Returns:
the table to which this selectable belongs; may be null

fieldTypeString

java.lang.String fieldTypeString()
Returns the string used to create a field of the appropriate type.

Returns:
a string useable by Field.create
See Also:
Field.create(java.lang.Long, jimm.datavision.Report, jimm.datavision.Section, java.lang.String, java.lang.Object, boolean)

reloadInstance

Selectable reloadInstance(DataSource dataSource)
Returns a (possibly new) instance of this selectable object. Used when we are reestablishing or resetting a connection to a database. The instance returned may or may not be the same object as this one.


getDisplayName

java.lang.String getDisplayName()