org.jboss.dna.graph.query.process
Class SelectComponent

java.lang.Object
  extended by org.jboss.dna.graph.query.process.ProcessingComponent
      extended by org.jboss.dna.graph.query.process.DelegatingComponent
          extended by org.jboss.dna.graph.query.process.SelectComponent

public class SelectComponent
extends DelegatingComponent


Nested Class Summary
static interface SelectComponent.Analyzer
          Inteface for criteria evaluation operations that cannot be defined efficiently, correctly, or completely using only the tuple values.
static interface SelectComponent.ConstraintChecker
          Interface used to determine whether a tuple satisfies all of the constraints applied to the SELECT node.
 
Constructor Summary
SelectComponent(ProcessingComponent delegate, Constraint constraint, Map<String,Object> variables)
          Create a SELECT processing component that pass those tuples that satisfy the supplied constraint.
SelectComponent(ProcessingComponent delegate, Constraint constraint, Map<String,Object> variables, SelectComponent.Analyzer analyzer)
          Create a SELECT processing component that pass those tuples that satisfy the supplied constraint, using the supplied SelectComponent.Analyzer for the verification of the more complex/arduous constraints.
 
Method Summary
 List<Object[]> execute()
          Execute this stage of processing and return the resulting tuples that each conform to the columns.
 
Methods inherited from class org.jboss.dna.graph.query.process.DelegatingComponent
close
 
Methods inherited from class org.jboss.dna.graph.query.process.ProcessingComponent
getColumns, getContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectComponent

public SelectComponent(ProcessingComponent delegate,
                       Constraint constraint,
                       Map<String,Object> variables)
Create a SELECT processing component that pass those tuples that satisfy the supplied constraint. Certain constraints (including FullTextSearch, SameNode and PropertyExistence) are evaluated in a fairly limited fashion, essentially operating upon the tuple values themselves.

For example, the SameNode constraint is satisfied when the selected node has the same path as the constraint's path. And the PropertyExistence constraint is satisfied when the property is represented in the tuple with a non-null value. Similarly, FullTextSearch always evaluates to true. Obviously these implementations will likely not be sufficient for many purposes. But in cases where these particular constraints are handled in other ways (and thus not expected to be seen by this processor), this form may be sufficient.

For more control over the behavior, use the constructor that takes an SelectComponent.Analyzer implementation (see SelectComponent(ProcessingComponent, Constraint, Map, Analyzer)).

Parameters:
delegate - the delegate processing component that this component should use to obtain the input tuples; may not be null
constraint - the query constraint; may not be null
variables - the map of variables keyed by their name (as used in BindVariableName constraints); may be null

SelectComponent

public SelectComponent(ProcessingComponent delegate,
                       Constraint constraint,
                       Map<String,Object> variables,
                       SelectComponent.Analyzer analyzer)
Create a SELECT processing component that pass those tuples that satisfy the supplied constraint, using the supplied SelectComponent.Analyzer for the verification of the more complex/arduous constraints.

Parameters:
delegate - the delegate processing component that this component should use to obtain the input tuples; may not be null
constraint - the query constraint; may not be null
variables - the map of variables keyed by their name (as used in BindVariableName constraints); may be null
analyzer - the analyzer; may be null
Method Detail

execute

public List<Object[]> execute()
Execute this stage of processing and return the resulting tuples that each conform to the columns.

Specified by:
execute in class ProcessingComponent
Returns:
the list of tuples, where each tuple corresonds to the columns; never null
See Also:
ProcessingComponent.execute()


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