Search in sources :

Example 1 with Evaluation

use of org.neo4j.graphdb.traversal.Evaluation in project neo4j by neo4j.

the class StandardBranchCollisionDetector method includePath.

protected boolean includePath(Path path, TraversalBranch startPath, TraversalBranch endPath) {
    Evaluation eval = evaluator.evaluate(path);
    if (!eval.continues()) {
        startPath.evaluation(eval);
        endPath.evaluation(eval);
    }
    return eval.includes();
}
Also used : Evaluation(org.neo4j.graphdb.traversal.Evaluation)

Example 2 with Evaluation

use of org.neo4j.graphdb.traversal.Evaluation in project neo4j by neo4j.

the class MultiEvaluator method evaluate.

/**
     * Returns whether or not the {@code position} is to be included and also
     * if it's going to be continued.
     *
     * The include/exclude part of the returned {@link Evaluation} will be
     * {@code include} if all of the internal evaluators think it's going to be
     * included, otherwise it will be excluded.
     *
     * The continue/prune part of the returned {@link Evaluation} will be
     * {@code continue} if all of the internal evaluators think it's going to be
     * continued, otherwise it will be pruned.
     *
     * @param position the {@link Path} to evaluate.
     * @see Evaluator
     */
public Evaluation evaluate(Path position, BranchState<STATE> state) {
    boolean includes = true;
    boolean continues = true;
    for (PathEvaluator<STATE> evaluator : this.evaluators) {
        Evaluation bla = evaluator.evaluate(position, state);
        if (!bla.includes()) {
            includes = false;
            if (!continues) {
                return Evaluation.EXCLUDE_AND_PRUNE;
            }
        }
        if (!bla.continues()) {
            continues = false;
            if (!includes) {
                return Evaluation.EXCLUDE_AND_PRUNE;
            }
        }
    }
    return Evaluation.of(includes, continues);
}
Also used : Evaluation(org.neo4j.graphdb.traversal.Evaluation)

Example 3 with Evaluation

use of org.neo4j.graphdb.traversal.Evaluation in project graphdb by neo4j-attic.

the class MultiEvaluator method evaluate.

public Evaluation evaluate(Path position) {
    boolean includes = true;
    boolean continues = true;
    for (Evaluator evaluator : this.evaluators) {
        Evaluation bla = evaluator.evaluate(position);
        if (!bla.includes()) {
            includes = false;
        }
        if (!bla.continues()) {
            continues = false;
        }
        if (!continues && !includes) {
            return Evaluation.EXCLUDE_AND_PRUNE;
        }
    }
    return Evaluation.of(includes, continues);
}
Also used : Evaluation(org.neo4j.graphdb.traversal.Evaluation) Evaluator(org.neo4j.graphdb.traversal.Evaluator)

Example 4 with Evaluation

use of org.neo4j.graphdb.traversal.Evaluation in project neo4j-mobile-android by neo4j-contrib.

the class MultiEvaluator method evaluate.

public Evaluation evaluate(Path position) {
    boolean includes = true;
    boolean continues = true;
    for (Evaluator evaluator : this.evaluators) {
        Evaluation bla = evaluator.evaluate(position);
        if (!bla.includes()) {
            includes = false;
        }
        if (!bla.continues()) {
            continues = false;
        }
        if (!continues && !includes) {
            return Evaluation.EXCLUDE_AND_PRUNE;
        }
    }
    return Evaluation.of(includes, continues);
}
Also used : Evaluation(org.neo4j.graphdb.traversal.Evaluation) Evaluator(org.neo4j.graphdb.traversal.Evaluator)

Aggregations

Evaluation (org.neo4j.graphdb.traversal.Evaluation)4 Evaluator (org.neo4j.graphdb.traversal.Evaluator)2