de.fuberlin.wiwiss.d2rq.map
Class TranslationTable.TranslatingValueSource

java.lang.Object
  extended byde.fuberlin.wiwiss.d2rq.map.TranslationTable.TranslatingValueSource
All Implemented Interfaces:
ValueSource
Enclosing class:
TranslationTable

private class TranslationTable.TranslatingValueSource
extends java.lang.Object
implements ValueSource


Field Summary
private  Translator translator
           
private  ValueSource valueSource
           
 
Constructor Summary
private TranslationTable.TranslatingValueSource(ValueSource valueSource, Translator translator)
           
 
Method Summary
 boolean couldFit(java.lang.String value)
          Checks if a given value fits this source without querying the database.
 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 getValue(java.lang.String[] row, java.util.Map columnNames)
          Retrieves a value from a database row according to some rule or pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valueSource

private ValueSource valueSource

translator

private Translator translator
Constructor Detail

TranslationTable.TranslatingValueSource

private TranslationTable.TranslatingValueSource(ValueSource valueSource,
                                                Translator translator)
Method Detail

couldFit

public boolean couldFit(java.lang.String value)
Description copied from interface: ValueSource
Checks if a given value fits this source without querying the database.

Specified by:
couldFit in interface ValueSource

getColumns

public java.util.Set getColumns()
Description copied from interface: ValueSource
Returns a set of all columns containing data necessary for this ValueSource.

Specified by:
getColumns in interface ValueSource
Returns:
a set of {Column}s

getColumnValues

public java.util.Map getColumnValues(java.lang.String value)
Description copied from interface: ValueSource
Returns a map of database fields and values corresponding to the argument.

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.

Specified by:
getColumnValues in interface ValueSource
Parameters:
value - a non-null value
Returns:
a map with Column keys, and string values.

getValue

public java.lang.String getValue(java.lang.String[] row,
                                 java.util.Map columnNames)
Description copied from interface: ValueSource
Retrieves a value from a database row according to some rule or pattern.

Specified by:
getValue in interface ValueSource
Parameters:
row - the database row
columnNames - a map from Table.Column style column names to Integer indices into the row array
Returns:
a value created from the row