Sha256: 622f120d0c6db6a58bc35270302c2d857dfa4b81f4b0896333c5bfb8162d51ae

Contents?: true

Size: 800 Bytes

Versions: 3

Compression:

Stored size: 800 Bytes

Contents

module Neo4j
  module Core

    module Traversal
      # Implements the Neo4j PruneEvaluator Java interface, only used internally.
      # @private
      class PruneEvaluator
        include Java::OrgNeo4jGraphdbTraversal::PathEvaluator

        def initialize(proc)
          @proc = proc
        end

        # for the state parameter see - http://api.neo4j.org/1.8.1/org/neo4j/graphdb/traversal/BranchState.html
        def evaluate(path, state)
          return Java::OrgNeo4jGraphdbTraversal::Evaluation::EXCLUDE_AND_CONTINUE if path.length == 0
          if @proc.call(path)
            Java::OrgNeo4jGraphdbTraversal::Evaluation::INCLUDE_AND_PRUNE
          else
            Java::OrgNeo4jGraphdbTraversal::Evaluation::INCLUDE_AND_CONTINUE
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
neo4j-core-2.3.0-java lib/neo4j-core/traversal/prune_evaluator.rb
neo4j-core-2.2.4-java lib/neo4j-core/traversal/prune_evaluator.rb
neo4j-core-2.2.3-java lib/neo4j-core/traversal/prune_evaluator.rb