StopEvaluator (Neo4j Community 2.1.0-M01 API)
Date: 2014-02-20

org.neo4j.graphdb

## Interface StopEvaluator

- Deprecated.
  because of the introduction of a new traversal framework, see more information at `TraversalDescription` and `Traversal` and the new traversal framework's equivalent `Evaluator`.

      public interface StopEvaluator

  A client hook for evaluating whether the traverser should traverse beyond a specific node. This is used for pruning the traversal.

  When a traverser is created, the client parameterizes it with a StopEvaluator. The traverser then invokes the `isStopNode()` operation just before traversing the relationships of a node, allowing the client to either approve or disapprove of traversing beyond that node.

  When implementing a StopEvaluator, the client investigates the information encapsulated in a `TraversalPosition` to decide whether to block traversal beyond a node or not. For example, here's a snippet detailing a StopEvaluator that blocks traversal beyond a node if it has a certain property value:

       StopEvaluator stopEvaluator = new StopEvaluator()
       {
           // Block traversal if the node has a property with key 'key' and value
           // 'someValue'
           public boolean isStopNode( TraversalPosition position )
           {
               if ( position.isStartNode() )
               {
                   return false;
               }
               Node node = position.currentNode();
               Object someProp = node.getProperty( "key", null );
               return someProp instanceof String &&
                   ((String) someProp).equals( "someValue" );
           }
       };

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static StopEvaluator` | `DEPTH_ONE` Deprecated. Traverses to depth 1.
    `static StopEvaluator` | `END_OF_GRAPH` Deprecated. Traverse until the end of the graph.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isStopNode(TraversalPosition currentPos)` Deprecated. Method invoked by traverser to see if current position is a stop node.

- - ### Field Detail

    - #### END_OF_GRAPH

          static final StopEvaluator END_OF_GRAPH

      Deprecated.
      Traverse until the end of the graph. This evaluator returns `false` all the time.

    - #### DEPTH_ONE

          static final StopEvaluator DEPTH_ONE

      Deprecated.
      Traverses to depth 1.

  - ### Method Detail

    - #### isStopNode

          boolean isStopNode(TraversalPosition currentPos)

      Deprecated.
      Method invoked by traverser to see if current position is a stop node.
      Parameters:
        `currentPos` - the traversal position
      Returns:
        True if current position is a stop node

Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.