Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.Direction


    ;

    int numRels = relTypes.size();
    for(int i=0; i<numRels; i++) {
      RelationshipType relType = relTypes.get(i);
      Direction direction = directions.get(i);
      description = description.relationships(relType, direction);
    }

    return description;
  }
View Full Code Here


  @Override
  public <A extends NodeInterface, B extends NodeInterface, S extends Source, T extends Target, R extends Relation<A, B, S, T>> Iterable<R> getRelationships(final Class<R> type) {

    final RelationshipFactory<R> factory = new RelationshipFactory<>(securityContext);
    final R template                     = getRelationshipForType(type);
    final Direction direction            = template.getDirectionForType(entityType);
    final RelationshipType relType       = template;

    return new IterableAdapter<>(dbNode.getRelationships(relType, direction), factory);
  }
View Full Code Here

    }

    private String buildQuery(Map<String, Object> params) {
        StringBuilder query = new StringBuilder("START n=node({id}) MATCH n");

        Direction direction = randomDirection();
        RelationshipQualifier typeOrProperty = (RelationshipQualifier) params.get(TYPE_OR_PROPERTY);

        if (INCOMING.equals(direction)) {
            query.append("<");
        }
View Full Code Here

      boolean isEndnode = this.node.equals(relationship.getEndNode());
      if (!isStartnode && !isEndnode){
        return false;
      }
     
      Direction relationshipDirection = isStartnode ? Direction.OUTGOING : Direction.INCOMING;
     
      if (this.direction != null && this.direction!= relationshipDirection){
        return false;
      }
           
View Full Code Here

        {
            @Override
            protected Iterator<Relationship> createNestedIterator(
                    RelationshipType type )
            {
                Direction dir = directions.get( type.name() );
                dir = ( dir == null ) ? Direction.BOTH : dir;
                return ( ( dir == Direction.BOTH ) ? start.getRelationships( type )
                        : start.getRelationships( type, dir ) ).iterator();
            }
        };
View Full Code Here

            String sep = "";
            for ( RelationshipType type : types )
            {
                result.append( sep );
                sep = ",";
                Direction dir = directions.get( type.name() );
                if ( dir != null )
                {
                    result.append( dir.name() );
                    result.append( ":" );
                }
                result.append( type.name() );
            }
        }
View Full Code Here

                return new FilteringIterator<Relationship>(
                        relationships.iterator(), new Predicate<Relationship>()
                        {
                            public boolean accept( Relationship rel )
                            {
                                Direction dir = directions.get( rel.getType().name() );
                                return matchDirection(
                                        dir == null ? Direction.BOTH : dir,
                                        start, rel );
                            }
                        } );
View Full Code Here

        }

        @Override
        public StandardExpander add( RelationshipType type, Direction direction )
        {
            Direction excluded = exclusion.get( type.name() );
            final Map<String, Direction> newExclusion;
            if ( excluded == null )
            {
                return this;
            }
View Full Code Here

                    start.getRelationships().iterator(),
                    new Predicate<Relationship>()
                    {
                        public boolean accept( Relationship item )
                        {
                            Direction dir = exclusion.get( item.getType().name() );
                            return !matchDirection( dir, start, item );
                        }
                    } );
        }
View Full Code Here

        }

        @Override
        public StandardExpander remove( RelationshipType type )
        {
            Direction excluded = exclusion.get( type.name() );
            if ( excluded == Direction.BOTH )
            {
                return this;
            }
            Map<String, Direction> newExclusion = new HashMap<String, Direction>(
View Full Code Here

TOP

Related Classes of org.neo4j.graphdb.Direction

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.