de.fuberlin.wiwiss.d2rq.algebra
Class RelationImpl

java.lang.Object
  extended by de.fuberlin.wiwiss.d2rq.algebra.RelationImpl
All Implemented Interfaces:
Relation, RelationalOperators

public class RelationImpl
extends Object
implements Relation


Field Summary
 
Fields inherited from interface de.fuberlin.wiwiss.d2rq.algebra.Relation
EMPTY, TRUE
 
Constructor Summary
RelationImpl(ConnectedDB database, AliasMap aliases, Expression condition, Set joinConditions)
           
 
Method Summary
 AliasMap aliases()
          The tables that are used to set up this relation, both in their aliased form, and with their original physical names.
 Expression condition()
          An expression that must be satisfied for all tuples in the relation.
 ConnectedDB database()
           
 Set joinConditions()
          Returns the join conditions that must hold between the tables in the relation.
 Relation renameColumns(ColumnRenamer renames)
          Applies the rename operator to this relation.
 Relation select(Expression selectCondition)
          Applies the selection operator to this relation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationImpl

public RelationImpl(ConnectedDB database,
                    AliasMap aliases,
                    Expression condition,
                    Set joinConditions)
Method Detail

database

public ConnectedDB database()
Specified by:
database in interface Relation

aliases

public AliasMap aliases()
Description copied from interface: Relation
The tables that are used to set up this relation, both in their aliased form, and with their original physical names.

Specified by:
aliases in interface Relation
Returns:
All table aliases required by this relation

condition

public Expression condition()
Description copied from interface: Relation
An expression that must be satisfied for all tuples in the relation.

Specified by:
condition in interface Relation
Returns:
An expression; Expression.TRUE indicates no condition

joinConditions

public Set joinConditions()
Description copied from interface: Relation
Returns the join conditions that must hold between the tables in the relation.

Specified by:
joinConditions in interface Relation
Returns:
A set of Joins

select

public Relation select(Expression selectCondition)
Description copied from interface: RelationalOperators

Applies the selection operator to this relation. The new relation will contain only the tuples for which the expression evaluates to true.

Selection on attributes that don't exist in the relation are considered to be always false and will cause an empty relation.

Specified by:
select in interface RelationalOperators
Parameters:
selectCondition - A boolean expression
Returns:
A relation whose tuples satisfy the condition

renameColumns

public Relation renameColumns(ColumnRenamer renames)
Description copied from interface: RelationalOperators

Applies the rename operator to this relation.

Renames of attributes that don't exist in the relation are ignored.

Specified by:
renameColumns in interface RelationalOperators
Parameters:
renames - A map from original to replacement names
Returns:
A relation in which all occurrences of the old names have been replaced with the new ones