Sha256: fb6ac92a587f0b92056079743530d573c0405c105e9f24d9fde2127a31d0b3af

Contents?: true

Size: 807 Bytes

Versions: 1

Compression:

Stored size: 807 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, state)
            Java::OrgNeo4jGraphdbTraversal::Evaluation::INCLUDE_AND_PRUNE
          else
            Java::OrgNeo4jGraphdbTraversal::Evaluation::INCLUDE_AND_CONTINUE
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neo4j-core-2.2.2-java lib/neo4j-core/traversal/prune_evaluator.rb