Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hp.hpl.jena.graph.query
Class ConstraintStage  view ConstraintStage download ConstraintStage.java

java.lang.Object
  extended bycom.hp.hpl.jena.graph.query.Stage
      extended bycom.hp.hpl.jena.graph.query.ConstraintStage

public class ConstraintStage
extends Stage

A ConstraintStage implements the constraint evaluation part of a query. Any constraints not handled by previous PatternStages are prepared against the mapping and valuated against each binding that comes down the pipe; only bindings that evaluate to true are passed onward.


Field Summary
protected  ValuatorSet prepared
          The set of prepared Valuators representing the constraint.
 
Fields inherited from class com.hp.hpl.jena.graph.query.Stage
previous, stillOpen
 
Constructor Summary
ConstraintStage(Mapping map, ExpressionSet constraint)
          Initialise this ConstraintStage with the mapping [from names to indexes] and ExpressionSet [the constraint expressions] that will be evaluated when the constraint stage runs.
 
Method Summary
 Pipe deliver(Pipe L)
          the delivery component: read the domain elements out of the input pipe, and only pass on those that satisfy the predicate.
private  boolean evalConstraint(Domain d, ValuatorSet e)
          Evaluate the prepared constraints with the values given by the domain.
 
Methods inherited from class com.hp.hpl.jena.graph.query.Stage
close, connectFrom, initial, isClosed, markClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prepared

protected ValuatorSet prepared
The set of prepared Valuators representing the constraint.

Constructor Detail

ConstraintStage

public ConstraintStage(Mapping map,
                       ExpressionSet constraint)
Initialise this ConstraintStage with the mapping [from names to indexes] and ExpressionSet [the constraint expressions] that will be evaluated when the constraint stage runs.

Method Detail

evalConstraint

private boolean evalConstraint(Domain d,
                               ValuatorSet e)
Evaluate the prepared constraints with the values given by the domain. Answer true if the constraint evaluates to true, and false if it evaluates to false or throws an exception.


deliver

public Pipe deliver(Pipe L)
the delivery component: read the domain elements out of the input pipe, and only pass on those that satisfy the predicate.

Specified by:
deliver in class Stage