org.modeshape.graph.query.process
Class JoinComponent

java.lang.Object
  extended by org.modeshape.graph.query.process.ProcessingComponent
      extended by org.modeshape.graph.query.process.JoinComponent
Direct Known Subclasses:
MergeJoinComponent, NestedLoopJoinComponent

public abstract class JoinComponent
extends ProcessingComponent


Nested Class Summary
protected static interface JoinComponent.Joinable
          Interface defining the value of a tuple that is used in the join condition.
protected static interface JoinComponent.TupleMerger
           
protected static interface JoinComponent.ValueSelector
          Interface defining the value of a tuple that is used in the join condition.
 
Nested classes/interfaces inherited from class org.modeshape.graph.query.process.ProcessingComponent
ProcessingComponent.DynamicOperation
 
Field Summary
protected static Comparator<Location> LOCATION_COMPARATOR
           
 
Constructor Summary
protected JoinComponent(QueryContext context, ProcessingComponent left, ProcessingComponent right, JoinCondition condition, JoinType joinType)
           
 
Method Summary
protected static Comparator<Object> comparatorFor(QueryContext context, ProcessingComponent left, ProcessingComponent right, JoinCondition condition)
          Create a Comparable that can be used to compare the values required to evaluate the supplied join condition.
protected static QueryResults.Columns computeJoinedColumns(QueryResults.Columns leftColumns, QueryResults.Columns rightColumns)
           
protected static JoinComponent.TupleMerger createMerger(QueryResults.Columns joinColumns, QueryResults.Columns leftColumns, QueryResults.Columns rightColumns)
           
 JoinCondition getJoinCondition()
          Get the join condition.
 JoinType getJoinType()
          Get the type of join this processor represents.
protected static JoinComponent.Joinable joinableFor(ProcessingComponent left, ProcessingComponent right, JoinCondition condition)
          Create a JoinComponent.ValueSelector that obtains the value required to use the supplied join condition.
protected  ProcessingComponent left()
          Get the processing component that serves as the left side of the join.
protected  QueryResults.Columns leftColunns()
          Get the columns definition for the results from the left side of the join.
protected  ProcessingComponent right()
          Get the processing component that serves as the right side of the join.
protected  QueryResults.Columns rightColumns()
          Get the columns definition for the results from the right side of the join.
protected static JoinComponent.ValueSelector valueSelectorFor(ProcessingComponent source, JoinCondition condition)
          Create a JoinComponent.ValueSelector that obtains the value required to use the supplied join condition.
 
Methods inherited from class org.modeshape.graph.query.process.ProcessingComponent
close, createDynamicOperation, createSortComparator, emptyTuples, execute, getColumns, getContext, problems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATION_COMPARATOR

protected static final Comparator<Location> LOCATION_COMPARATOR
Constructor Detail

JoinComponent

protected JoinComponent(QueryContext context,
                        ProcessingComponent left,
                        ProcessingComponent right,
                        JoinCondition condition,
                        JoinType joinType)
Method Detail

getJoinType

public final JoinType getJoinType()
Get the type of join this processor represents.

Returns:
the join type; never null

getJoinCondition

public final JoinCondition getJoinCondition()
Get the join condition.

Returns:
the join condition; never null

left

protected final ProcessingComponent left()
Get the processing component that serves as the left side of the join.

Returns:
the left-side processing component; never null

right

protected final ProcessingComponent right()
Get the processing component that serves as the right side of the join.

Returns:
the right-side processing component; never null

leftColunns

protected final QueryResults.Columns leftColunns()
Get the columns definition for the results from the left side of the join.

Returns:
the left-side columns that feed this join; never null

rightColumns

protected final QueryResults.Columns rightColumns()
Get the columns definition for the results from the right side of the join.

Returns:
the right-side columns that feed this join; never null

computeJoinedColumns

protected static QueryResults.Columns computeJoinedColumns(QueryResults.Columns leftColumns,
                                                           QueryResults.Columns rightColumns)

createMerger

protected static JoinComponent.TupleMerger createMerger(QueryResults.Columns joinColumns,
                                                        QueryResults.Columns leftColumns,
                                                        QueryResults.Columns rightColumns)

valueSelectorFor

protected static JoinComponent.ValueSelector valueSelectorFor(ProcessingComponent source,
                                                              JoinCondition condition)
Create a JoinComponent.ValueSelector that obtains the value required to use the supplied join condition.

Parameters:
source - the source component; may not be null
condition - the join condition; may not be null
Returns:
the value selector; never null

joinableFor

protected static JoinComponent.Joinable joinableFor(ProcessingComponent left,
                                                    ProcessingComponent right,
                                                    JoinCondition condition)
Create a JoinComponent.ValueSelector that obtains the value required to use the supplied join condition.

Parameters:
left - the left source component; may not be null
right - the left source component; may not be null
condition - the join condition; may not be null
Returns:
the value selector; never null

comparatorFor

protected static Comparator<Object> comparatorFor(QueryContext context,
                                                  ProcessingComponent left,
                                                  ProcessingComponent right,
                                                  JoinCondition condition)
Create a Comparable that can be used to compare the values required to evaluate the supplied join condition.

Parameters:
context - the context in which this query is being evaluated; may not be null
left - the left source component; may not be null
right - the left source component; may not be null
condition - the join condition; may not be null
Returns:
the comparator; never null


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.