de.fuberlin.wiwiss.d2rq.values
Class SQLExpressionValueMaker

java.lang.Object
  extended by de.fuberlin.wiwiss.d2rq.values.SQLExpressionValueMaker
All Implemented Interfaces:
ValueMaker

public class SQLExpressionValueMaker
extends Object
implements ValueMaker

A value maker that creates its values from a SQL expression. TODO Write unit tests

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
 
Fields inherited from interface de.fuberlin.wiwiss.d2rq.values.ValueMaker
NULL
 
Constructor Summary
SQLExpressionValueMaker(Expression expression)
           
 
Method Summary
 void describeSelf(NodeSetFilter c)
           
 boolean equals(Object other)
           
 int hashCode()
           
 String makeValue(ResultRow row)
          Retrieves a value from a database row according to some rule or pattern.
 List<OrderSpec> orderSpecs(boolean ascending)
           
 Set<ProjectionSpec> projectionSpecs()
          Returns a set of all ProjectionSpecs containing data necessary for this ValueSource.
 ValueMaker renameAttributes(ColumnRenamer renamer)
           
 String toString()
           
 Expression valueExpression(String value)
          A SQL expression that selects only rows where this value maker produces the specified value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLExpressionValueMaker

public SQLExpressionValueMaker(Expression expression)
Method Detail

describeSelf

public void describeSelf(NodeSetFilter c)
Specified by:
describeSelf in interface ValueMaker

projectionSpecs

public Set<ProjectionSpec> projectionSpecs()
Description copied from interface: ValueMaker
Returns a set of all ProjectionSpecs containing data necessary for this ValueSource.

Specified by:
projectionSpecs in interface ValueMaker
Returns:
a set of ProjectionSpecs

makeValue

public String makeValue(ResultRow row)
Description copied from interface: ValueMaker
Retrieves a value from a database row according to some rule or pattern.

Specified by:
makeValue in interface ValueMaker
Parameters:
row - the database row
Returns:
a value created from the row

valueExpression

public Expression valueExpression(String value)
Description copied from interface: ValueMaker
A SQL expression that selects only rows where this value maker produces the specified value. Expression.FALSE if this value maker is incapable of producing the value.

Specified by:
valueExpression in interface ValueMaker
Parameters:
value - A value
Returns:
An expression that selects rows that produce this value

renameAttributes

public ValueMaker renameAttributes(ColumnRenamer renamer)
Specified by:
renameAttributes in interface ValueMaker

orderSpecs

public List<OrderSpec> orderSpecs(boolean ascending)
Specified by:
orderSpecs in interface ValueMaker

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object