|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fuberlin.wiwiss.d2rq.map.Column
A database column.
History:
08-03-2004: Initial version of this class.
Field Summary | |
private java.lang.String |
columnName
|
private java.lang.String |
qualifiedName
|
private java.lang.String |
tableName
|
Constructor Summary | |
Column(java.lang.String qualifiedName)
Constructs a new Column from a fully qualified column name |
|
Column(java.lang.String tableName,
java.lang.String colName)
|
Method Summary | |
static java.lang.String |
appendTableColumn(java.lang.String t,
java.lang.String c)
|
java.lang.Object |
clone()
Make a shallow copy of this . |
boolean |
couldFit(java.lang.String value)
Checks if a given value fits this source without querying the database. |
boolean |
equals(java.lang.Object other)
Compares this instance to another object. |
java.lang.String |
getColumnName()
Extracts the database column name from a tablename.columnname combination. |
java.util.Set |
getColumns()
Returns a set of all columns containing data necessary for this ValueSource. |
java.util.Map |
getColumnValues(java.lang.String value)
Returns a map of database fields and values corresponding to the argument. |
java.lang.String |
getQualifiedName()
Returns the column name in Table.Column form |
java.lang.String |
getQualifiedName(java.util.Map aliasMap)
|
java.lang.String |
getTableName()
Extracts the database table name from a tablename.columnname combination. |
java.lang.String |
getValue(java.lang.String[] row,
java.util.Map columnNameNumberMap)
Returns the value of this column from a database row. |
int |
hashCode()
Returns a hash code for this intance. |
void |
prefixTables(TablePrefixer prefixer)
Changes the fields in a newly created clone that are to be modified when making aliasses. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.lang.String qualifiedName
private java.lang.String tableName
private final java.lang.String columnName
Constructor Detail |
public Column(java.lang.String qualifiedName)
qualifiedName
- the column's name, for example Table.Columnpublic Column(java.lang.String tableName, java.lang.String colName)
Method Detail |
public static java.lang.String appendTableColumn(java.lang.String t, java.lang.String c)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Prefixable
this
.
General advice: Do not overwrite clone().
prefixTables() works best with shallow copy which Object implements.
Issues: I have not found a (preferred) static equivalent of clone().
Since Objects clone() method is protected, we cannot just declare
Cloneable
, if we want to call clone() from outside of that
class hierarchy. Instead it must be public and implemented in each
Prefixable class by a call to super.clone().
clone
in interface Prefixable
java.lang.CloneNotSupportedException
public void prefixTables(TablePrefixer prefixer)
Prefixable
prefixTables
in interface Prefixable
prefixer
- does the actual prefixing of simple and complex types.public java.lang.String getQualifiedName()
public java.lang.String getQualifiedName(java.util.Map aliasMap)
public java.lang.String getColumnName()
public java.lang.String getTableName()
public boolean couldFit(java.lang.String value)
ValueSource
couldFit
in interface ValueSource
public java.util.Set getColumns()
ValueSource
getColumns
in interface ValueSource
public java.util.Map getColumnValues(java.lang.String value)
ValueSource
For example, a ValueSource that corresponds directly to a single DB column would return a single-entry map with that column as the key, and value as the value.
getColumnValues
in interface ValueSource
value
- a non-null value
Column
keys, and string values.public java.lang.String getValue(java.lang.String[] row, java.util.Map columnNameNumberMap)
getValue
in interface ValueSource
row
- a database rowcolumnNameNumberMap
- a map from qualified column names to indices into the row
array
public java.lang.String toString()
public boolean equals(java.lang.Object other)
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |