本文整理了Java中org.neo4j.graphdb.Direction.name()
方法的一些代码示例,展示了Direction.name()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Direction.name()
方法的具体详情如下:
包路径:org.neo4j.graphdb.Direction
类名称:Direction
方法名:name
暂无
代码示例来源:origin: neo4j/neo4j
protected static RelationshipGroupRecord withRelationship( RelationshipGroupRecord group, Direction direction,
long rel )
{
switch ( direction )
{
case OUTGOING:
group.setFirstOut( rel );
break;
case INCOMING:
group.setFirstIn( rel );
break;
case BOTH:
group.setFirstLoop( rel );
break;
default:
throw new IllegalArgumentException( direction.name() );
}
return group;
}
代码示例来源:origin: neo4j/neo4j
@Test
public void canAddLoopRelationship()
{
Node node = getGraphDb().createNode();
node.createRelationshipTo( node, TEST );
newTransaction();
for ( Direction dir : Direction.values() )
{
int count = 0;
for ( Relationship rel : node.getRelationships( dir ) )
{
count++;
assertEquals( "start node", node, rel.getStartNode() );
assertEquals( "end node", node, rel.getEndNode() );
assertEquals( "other node", node, rel.getOtherNode( node ) );
}
assertEquals( dir.name() + " relationship count", 1, count );
}
}
代码示例来源:origin: stackoverflow.com
public static MapLocation[] getLocs(Direction dir) {
return valueOf(dir.name()).locs;
}
代码示例来源:origin: neo4j-contrib/neo4j-graph-algorithms
public ProcedureConfiguration overrideDirection(Direction direction) {
config.put(ProcedureConstants.DIRECTION, direction.name());
return this;
}
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
public Result done() {
Result result = new Result();
result.type = typeName;
result.direction = direction.name();
result.total = total;
result.max = histogram.getMaxValue();
result.min = histogram.getMinValue();
result.mean = histogram.getMean();
result.p50 = histogram.getValueAtPercentile(50);
result.p75 = histogram.getValueAtPercentile(75);
result.p90 = histogram.getValueAtPercentile(90);
result.p95 = histogram.getValueAtPercentile(95);
result.p99 = histogram.getValueAtPercentile(99);
result.p999 = histogram.getValueAtPercentile(99.9);
this.histogram.reset();
this.histogram = null;
return result;
}
}
代码示例来源:origin: stackoverflow.com
Direction travelDirection = Direction.NORTH;
System.out.println("I am going " + travelDirection.name());
代码示例来源:origin: org.neo4j/graph-algorithms-core
public ProcedureConfiguration overrideDirection(Direction direction) {
config.put(ProcedureConstants.DIRECTION, direction.name());
return this;
}
代码示例来源:origin: SciGraph/SciGraph
@Override
public String toString() {
return type.name() + " - " + direction.name();
}
代码示例来源:origin: com.graphaware.neo4j/timetree
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + timestampProperty.hashCode();
result = 31 * result + customTimeTreeRootProperty.hashCode();
result = 31 * result + resolution.hashCode();
result = 31 * result + timeZone.hashCode();
result = 31 * result + relationshipType.hashCode();
result = 31 * result + direction.name().hashCode();
result = 31 * result + (autoAttach ? 1 : 0);
return result;
}
}
代码示例来源:origin: neo4j-contrib/neo4j-graph-algorithms
public Direction getDirection(Direction defaultDirection) {
return Directions.fromString(getDirectionName(defaultDirection.name()));
}
代码示例来源:origin: org.neo4j/graph-algorithms-core
public Direction getDirection(Direction defaultDirection) {
return Directions.fromString(getDirectionName(defaultDirection.name()));
}
代码示例来源:origin: maxdemarzi/graph_processing
public DegreeArrayStorageParallelSPI(GraphDatabaseService db, ExecutorService pool, Direction direction) {
this.pool = pool;
this.db = (GraphDatabaseAPI)db;
this.nodeCount = new NodeCounter().getNodeCount(db);
this.direction = direction;
if (!direction.equals(Direction.BOTH)) {
directionName = direction.name().toLowerCase() + "_";
}
}
代码示例来源:origin: neo4j-contrib/graph-collections
private NodeCollection getNodeCollection()
{
Relationship indexRelationship = null;
for ( Relationship candidateRelationship : this.indexedNode.getRelationships( RelationshipTypes.NODE_COLLECTION, Direction.OUTGOING ) )
{
String relName = (String) candidateRelationship.getProperty( RELATIONSHIP_TYPE, null );
if ( relType.name().equals( relName ) )
{
String dir = (String) candidateRelationship.getProperty( RELATIONSHIP_DIRECTION, null );
if ( direction.name().equals( dir ) )
{
if ( indexRelationship != null ) {
throw new IllegalStateException(
"Multiple IndexedRelationship's on the given node with relationship type: " +
relType.name() + " and direction: " + direction.name());
}
indexRelationship = candidateRelationship;
}
}
}
if ( indexRelationship != null )
{
return NodeCollectionLoader.load(indexRelationship.getEndNode());
}
return null;
}
代码示例来源:origin: com.graphaware.neo4j/timetree
public EventResult(Event event){
node = event.getNode();
relationshipType = event.getRelationshipType().name();
direction = event.getDirection().name();
}
}
代码示例来源:origin: neo4j-contrib/graph-collections
/**
* Create an IndexedRelationship against this node with the given relationship type and direction. The node
* collection supplied to the IndexedRelationship must already have a base node. The node collection may or may not
* have any other nodes related to it.
*
* @param nodeCollection the { @link NodeCollection } backing this indexed relationship.
*/
public void create( NodeCollection nodeCollection )
{
Relationship indexRelationship = indexedNode.createRelationshipTo( nodeCollection.getBaseNode(), RelationshipTypes.NODE_COLLECTION );
indexRelationship.setProperty( RELATIONSHIP_TYPE, relType.name() );
indexRelationship.setProperty( RELATIONSHIP_DIRECTION, direction.name() );
this.nodeCollection = nodeCollection;
}
代码示例来源:origin: org.neo4j/neo4j-graph-collections
/**
* Create an IndexedRelationship against this node with the given relationship type and direction. The node
* collection supplied to the IndexedRelationship must already have a base node. The node collection may or may not
* have any other nodes related to it.
*
* @param nodeCollection the { @link NodeCollection } backing this indexed relationship.
*/
public void create( NodeCollection nodeCollection )
{
Relationship indexRelationship = indexedNode.createRelationshipTo( nodeCollection.getBaseNode(), RelationshipTypes.NODE_COLLECTION );
indexRelationship.setProperty( RELATIONSHIP_TYPE, relType.name() );
indexRelationship.setProperty( RELATIONSHIP_DIRECTION, direction.name() );
this.nodeCollection = nodeCollection;
}
代码示例来源:origin: com.graphaware.neo4j/timetree
/**
* Convert this event to its corresponding value object.
*
* @return value object.
*/
public EventVO toValueObject() {
return new EventVO(new LongIdJsonNode(node), getRelationshipType().name(), getDirection().name());
}
}
代码示例来源:origin: org.neo4j/neo4j-consistency-check-legacy
protected static RelationshipGroupRecord withRelationship( RelationshipGroupRecord group, Direction direction,
long rel )
{
switch ( direction )
{
case OUTGOING:
group.setFirstOut( rel );
break;
case INCOMING:
group.setFirstIn( rel );
break;
case BOTH:
group.setFirstLoop( rel );
break;
default:
throw new IllegalArgumentException( direction.name() );
}
return group;
}
代码示例来源:origin: neo4j-contrib/graph-collections
/**
* Creates a relationship from the indexed node to the supplied node
*
* @param node the end node of the relationship.
*
* @return the relationship that was created between the indexedNode and the end node..
*/
public Relationship createRelationshipTo( Node node )
{
Relationship keyValueRelationship = nodeCollection.addNode( node );
if ( !keyValueRelationship.hasProperty( RELATIONSHIP_DIRECTION ) )
{
keyValueRelationship.setProperty( RELATIONSHIP_DIRECTION, direction.name() );
}
if ( !keyValueRelationship.hasProperty( RELATIONSHIP_TYPE ) )
{
keyValueRelationship.setProperty( RELATIONSHIP_TYPE, relType.name() );
}
return getRelationship( keyValueRelationship );
}
代码示例来源:origin: org.neo4j/neo4j-graph-collections
/**
* Creates a relationship from the indexed node to the supplied node
*
* @param node the end node of the relationship.
*
* @return the relationship that was created between the indexedNode and the end node..
*/
public Relationship createRelationshipTo( Node node )
{
Relationship keyValueRelationship = nodeCollection.addNode( node );
if ( !keyValueRelationship.hasProperty( RELATIONSHIP_DIRECTION ) )
{
keyValueRelationship.setProperty( RELATIONSHIP_DIRECTION, direction.name() );
}
if ( !keyValueRelationship.hasProperty( RELATIONSHIP_TYPE ) )
{
keyValueRelationship.setProperty( RELATIONSHIP_TYPE, relType.name() );
}
return getRelationship( keyValueRelationship );
}
内容来源于网络,如有侵权,请联系作者删除!