[Neo4j] zero fromDepth and toDepth

Peter Neubauer peter.neubauer at neotechnology.com
Thu Nov 3 03:33:13 CET 2011


Alex,
looking at the source, the Evaluators.toDepth() does:

public static Evaluator toDepth( final int depth )
    {
        return new Evaluator()
        {
            public Evaluation evaluate( Path path )
            {
                return path.length() < depth ?
Evaluation.INCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_PRUNE;
            }
        };
    }

So it won't work. However, question is if it should be inclusive or
not. WDYAT? I could change it to

return path.length() <= depth ? Evaluation.INCLUDE_AND_CONTINUE :
Evaluation.INCLUDE_AND_PRUNE;

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org              - NOSQL for the Enterprise.
http://startupbootcamp.org/    - Öresund - Innovation happens HERE.



On Wed, Nov 2, 2011 at 11:59 AM, Alex <aus at auv.name> wrote:
> Hi everybody
>
> when setting fromDepth and toDepth both at zero, like in the following code
>
> Traversal.description.breadthFirst
>  .evaluator(Evaluators.fromDepth(0))
>  .evaluator(Evaluators.toDepth(0))
>
> I'm expecting to get only the start node, but I don't. Am I missing
> anything?
>
> Thanks!
>
> Cheers
> Alex
>
> --
> View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3474825.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> _______________________________________________
> Neo4j mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>


More information about the User mailing list