ModeShape Distribution 3.1.2.Final

org.modeshape.jcr.query.process
Class SetOperationComponent

java.lang.Object
  extended by org.modeshape.jcr.query.process.ProcessingComponent
      extended by org.modeshape.jcr.query.process.SetOperationComponent
Direct Known Subclasses:
ExceptComponent, IntersectComponent, UnionComponent

public abstract class SetOperationComponent
extends ProcessingComponent


Nested Class Summary
 
Nested classes/interfaces inherited from class org.modeshape.jcr.query.process.ProcessingComponent
ProcessingComponent.DynamicOperation
 
Field Summary
protected  Comparator<Object[]> removeDuplicatesComparator
           
 
Constructor Summary
protected SetOperationComponent(QueryContext context, QueryResults.Columns columns, Iterable<ProcessingComponent> sources, boolean alreadySorted, boolean all)
           
 
Method Summary
 QueryResults.Columns getColumns()
          Get the column definitions.
protected  void removeDuplicatesIfRequested(List<Object[]> tuples)
           
protected  Iterable<ProcessingComponent> sources()
           
protected static boolean unionCompatible(QueryResults.Columns columns, Iterable<ProcessingComponent> sources)
           
protected static Iterable<ProcessingComponent> wrapWithLocationOrdering(Iterable<ProcessingComponent> sources, boolean alreadySorted)
          The sources' results must be sorted before the intersection can be computed.
 
Methods inherited from class org.modeshape.jcr.query.process.ProcessingComponent
close, createDynamicOperation, createSortComparator, emptyTuples, execute, getContext, problems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

removeDuplicatesComparator

protected final Comparator<Object[]> removeDuplicatesComparator
Constructor Detail

SetOperationComponent

protected SetOperationComponent(QueryContext context,
                                QueryResults.Columns columns,
                                Iterable<ProcessingComponent> sources,
                                boolean alreadySorted,
                                boolean all)
Method Detail

unionCompatible

protected static boolean unionCompatible(QueryResults.Columns columns,
                                         Iterable<ProcessingComponent> sources)

getColumns

public QueryResults.Columns getColumns()
Description copied from class: ProcessingComponent
Get the column definitions.

Overrides:
getColumns in class ProcessingComponent
Returns:
the column mappings; never null

sources

protected Iterable<ProcessingComponent> sources()
Returns:
sources

wrapWithLocationOrdering

protected static Iterable<ProcessingComponent> wrapWithLocationOrdering(Iterable<ProcessingComponent> sources,
                                                                        boolean alreadySorted)
The sources' results must be sorted before the intersection can be computed. Ensure that the sources' results are indeed sorted, and if not wrap them in a sorting component.

Parameters:
sources - the sources being intersected; may not be null
alreadySorted - true if the sources' results are already sorted, or false if they must be sorted by this component
Returns:
the sources (or their wrappers); never null

removeDuplicatesIfRequested

protected void removeDuplicatesIfRequested(List<Object[]> tuples)

ModeShape Distribution 3.1.2.Final

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