Package org.neo4j.graphdb.traversal

Examples of org.neo4j.graphdb.traversal.TraversalBranch


        public TraversalBranch next()
        {
            // Exhaust current if not already exhausted
            while ( true )
            {
                TraversalBranch next = current.next();
                if ( next != null )
                {
                    if ( !visitedNodes.contains( next.node().getId() ) )
                    {
                        // Adding the path weight for usage by the WaitingTimeCostEvaluator
                        P newPriority = addPriority( next,
                                currentAggregatedValue,
                                calculateValue( next, currentAggregatedValue ) );
View Full Code Here


        this.threshold = startThreshold;
    }
   
    public TraversalBranch next()
    {
        TraversalBranch result = null;
        while ( result == null )
        {
            if ( current == null )
            {
                current = superNodes.poll();
                if ( current == null )
                {
                    return null;
                }
            }
            else if ( current.expanded() > 0 && current.expanded() % threshold == 0 )
            {
                superNodes.add( current );
                current = current.parent();
                continue;
            }
           
            TraversalBranch next = current.next();
            if ( next == null )
            {
                current = current.parent();
                continue;
            }
View Full Code Here

        public TraversalBranch next()
        {
            // Exhaust current if not already exhausted
            while ( true )
            {
                TraversalBranch next = current.next();
                if ( next != null )
                {
                    if ( !visitedNodes.contains( next.node().getId() ) )
                    {
                        P newPriority = addPriority( next, currentAggregatedValue,
                                calculateValue( next ) );
                        queue.put( next, newPriority );
                    }
View Full Code Here

        this.current = startSource;
    }
   
    public TraversalBranch next()
    {
        TraversalBranch result = null;
        while ( result == null )
        {
            if ( current == null )
            {
                return null;
            }
           
            TraversalBranch next = current.next();
            if ( next != null )
            {
                current = next;
            }
            else
View Full Code Here

        }

        @Override
        protected Path fetchNextOrNull()
        {
            TraversalBranch result = null;
            while ( true )
            {
                result = sourceSelector.next();
                if ( result == null )
                {
                    return null;
                }
                if ( result.evaluation().includes() )
                {
                    return result.position();
                }
            }
        }
View Full Code Here

            {
                continue;
            }
            expandedCount++;
            Node node = relationship.getOtherNode( source );
            TraversalBranch next = new TraversalBranchImpl( traverser, this, depth + 1, node,
                    traverser.description.expander, relationship );
            if ( traverser.okToProceed( next ) )
            {
                next.initialize();
                return next;
            }
        }
        return null;
    }
View Full Code Here

            // because even if there would be a situation where two (or more)
            // threads comes here at the same time everything would still
            // work as expected (in here as well as outside).
            LinkedList<Node> nodesList = new LinkedList<Node>();
            LinkedList<Relationship> relationshipsList = new LinkedList<Relationship>();
            TraversalBranch stepper = branch;
            while ( stepper != null )
            {
                nodesList.addFirst( stepper.node() );
                Relationship relationship = stepper.relationship();
                if (relationship != null)
                {
                    relationshipsList.addFirst( relationship );
                }
                stepper = stepper.parent();
            }
            nodes = nodesList;
            relationships = relationshipsList;
        }
    }
View Full Code Here

                break;
            }
           
            while ( true )
            {
                TraversalBranch next = source.next();
                if ( next == null )
                {
                    break;
                }
                level.add( next );
View Full Code Here

        this.current = startSource;
    }
   
    public TraversalBranch next()
    {
        TraversalBranch result = null;
        while ( result == null )
        {
            if ( current == null )
            {
                return null;
            }
            TraversalBranch next = current.next();
            if ( next == null )
            {
                current = current.parent();
                continue;
            }
View Full Code Here

        this.current = startSource;
    }

    public TraversalBranch next()
    {
        TraversalBranch result = null;
        while ( result == null )
        {
            TraversalBranch next = current.next();
            if ( next != null )
            {
                queue.add( next );
                result = next;
            }
View Full Code Here

TOP

Related Classes of org.neo4j.graphdb.traversal.TraversalBranch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.