org.modeshape.jcr.query.process

## Class SetOperationComponent

- java.lang.Object
- - org.modeshape.jcr.query.process.ProcessingComponent
  - - 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Comparator<Object[]>` | `removeDuplicatesComparator`
    `protected List<QueryResults.TupleReformatter>` | `sourceReformatters`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SetOperationComponent(QueryContext context, QueryResults.Columns columns, Iterable<ProcessingComponent> sources, boolean alreadySorted, boolean all)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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, getLocationIndexes, problems`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### sourceReformatters

          protected final List<QueryResults.TupleReformatter> sourceReformatters

    - #### 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)

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